Public report of apache/druid, published 13 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.3). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 13 November 2026, 16:26 UTC · Survey ID cd_caec069fc3044262afd9b9d0ec8354e5
apache/druid
Measured 13 November 2026, 16:21 UTC, at code version 2b71ffb
Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.
CAI scoreAt riskUp 5 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 936,063 lines of product code in 80 projects, tests not counted · Estimated rebuild effort: about 14.5 person-years · Weakest lens: Accessibility, 44
Findings by how serious they are
92 critical5474 serious3517 minor
18 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
13 November 2026, 16:21 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
80of 80 dimensions measured by tools.
9045of 9083 findings point to an exact file and line, so you can open each one in the code. The other 38 concern the repository as a whole, such as missing documentation.
80dimensions across 7 lenses, read from 936,063 lines of product code in 80 projects.
apache/druid is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back in part because it has controls that only work with a mouse. It scores 49 out of 100, which the At risk rating leaves unchanged.
Accessibility, at 44, is the weakest lens by a small margin, and the weakest lens counts most in the score. The best first step is making the five tests that check nothing check their results, worth about 3 points. Making the controls keyboard-usable would lift Accessibility itself, also worth about 3.
Twenty-one pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Nine controls can't be used without a mouse, and twenty-six parts of the code are no longer understood by anyone working on it. Making the controls work with a keyboard, pinning each tool to an exact version and having someone learn the forgotten files would close these risks. Updating the vulnerable packages would fix the three packages with a known security hole, and setting a waiting period for automatic updates would deal with the two automatic dependency updates that take new releases at once. The seven pieces of product code that depend on test code need their reference to the test project removed.
The product code is 936,063 lines, about €2,100,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
The weakest lenses score close to each other, so improving any of them moves the score.
Code composition: what the lines of code are
Product code 49%Tests 51%
New since the last survey: 1265 findings
These 1265 critical or serious findings weren't in the previous survey, on 24 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FileTooLong: http/LookupCoordinatorResource.java server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java
God Classes · TooManyMethods: LookupCoordinatorResource server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java
God Classes · TooManyMethods: Projections processing/src/main/java/org/apache/druid/segment/projections/Projections.java
God Classes · ClassTooLong: ServerManager server/src/main/java/org/apache/druid/server/ServerManager.java
Code Duplication · Near-duplicate member pair (72 shared lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) extensions-core/testing-tools/src/main/java/org/apache/druid/testing/cli/CliEventCollector.java
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchUtils.java
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregator.java
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java
Code Duplication · Edited copy of a member (235 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java
Code Duplication · Edited copy of a member (151 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java
Code Duplication · Edited copy of a member (98 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java
Code Duplication · Edited copy of a member (112 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java
Code Duplication · Edited copy of a member (81 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java
Code Duplication · Edited copy of a member (97 corresponding lines) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java
Code Duplication · Edited copy of a member (60 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java
Code Duplication · Edited copy of a member (65 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java
Code Duplication · Edited copy of a member (51 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java
Code Duplication · Edited copy of a member (69 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java
Code Duplication · Edited copy of a member (63 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java
Code Duplication · Edited copy of a member (86 corresponding lines) services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java
Code Duplication · Edited copy of a member (74 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java
Code Duplication · Edited copy of a member (64 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java
Code Duplication · Edited copies of one member (3 members, 82+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java
Code Duplication · Edited copy of a member (53 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java
Code Duplication · Edited copy of a member (56 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java
Code Duplication · Edited copy of a member (51 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java
Code Duplication · Edited copy of a member (73 corresponding lines) processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java
Code Duplication · Edited copy of a member (61 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java
Code Duplication · Edited copy of a member (46 corresponding lines) server/src/main/java/org/apache/druid/client/selector/PooledTierSelectorStrategy.java
Code Duplication · Edited copy of a member (48 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java
Code Duplication · Edited copy of a member (58 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java
Code Duplication · Edited copy of a member (48 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java
Code Duplication · Edited copies of one member (3 members, 66+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java
Code Duplication · Edited copy of a member (61 corresponding lines) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/expressions/BloomFilterExpressions.java
Code Duplication · Edited copy of a member (90 corresponding lines) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java
Code Duplication · Edited copy of a member (65 corresponding lines) processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java
Code Duplication · Edited copy of a member (51 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryStageProcessor.java
Code Duplication · Edited copies of one member (3 members, 66+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java
Code Duplication · Edited copy of a member (50 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Parser.java
Code Duplication · Edited copy of a member (47 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java
Code Duplication · Edited copies of one member (3 members, 68+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java
Code Duplication · Edited copies of one member (4 members, 61+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java
Code Duplication · Edited copies of one member (3 members, 60+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java
Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateDoubleProcessorFactory.java
Code Duplication · Edited copy of a member (45 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java
Code Duplication · Edited copy of a member (46 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/AbstractSerializablePairLongObjectDeltaEncodedStagedSerde.java
Code Duplication · Edited copy of a member (40 corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java
Code Duplication · Edited copies of one member (3 members, 45+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java
Code Duplication · Edited copy of a member (32 corresponding lines) processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java
Code Duplication · Edited copies of one member (6 members, 23+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java
Code Duplication · Edited copy of a member (40 corresponding lines) server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java
Code Duplication · Edited copy of a member (76 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java
Code Duplication · Edited copy of a member (40 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java
Code Duplication · Edited copy of a member (50 corresponding lines) extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java
Code Duplication · Edited copy of a member (34 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java
Code Duplication · Edited copy of a member (36 corresponding lines) processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java
Code Duplication · Edited copy of a member (33 corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java
Code Duplication · Edited copy of a member (32 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlInsert.java
Code Duplication · Edited copy of a member (72 corresponding lines) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java
Code Duplication · Edited copy of a member (35 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskLocks.java
Code Duplication · Edited copy of a member (47 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java
Code Duplication · Edited copy of a member (50 corresponding lines) server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java
Code Duplication · Edited copy of a member (43 corresponding lines) server/src/main/java/org/apache/druid/client/BrokerServerView.java
Code Duplication · Edited copy of a member (66 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java
Code Duplication · Edited copy of a member (37 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java
Code Duplication · Edited copy of a member (43 corresponding lines) processing/src/main/java/org/apache/druid/query/CursorGranularizer.java
Code Duplication · Edited copy of a member (33 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java
Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java
Code Duplication · Edited copy of a member (38 corresponding lines) server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java
Code Duplication · Edited copy of a member (47 corresponding lines) extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java
Code Duplication · Edited copies of one member (3 members, 59+ corresponding lines) processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java
Code Duplication · Edited copy of a member (33 corresponding lines) processing/src/main/java/org/apache/druid/segment/projections/RollupTableProjectionSchema.java
Code Duplication · Edited copy of a member (46 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java
Code Duplication · Edited copy of a member (53 corresponding lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java
Code Duplication · Edited copy of a member (27 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssStorageDruidModule.java
Code Duplication · Edited copy of a member (42 corresponding lines) server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java
Code Duplication · Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/hll/HyperLogLogCollector.java
Code Duplication · Edited copy of a member (41 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java
Code Duplication · Edited copy of a member (28 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java
Code Duplication · Edited copy of a member (40 corresponding lines) extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java
Code Duplication · Edited copy of a member (54 corresponding lines) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java
Code Duplication · Edited copies of one member (6 members, 26+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMaxVectorAggregator.java
Code Duplication · Edited copies of one member (3 members, 43+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java
Code Duplication · Edited copy of a member (31 corresponding lines) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java
Code Duplication · Edited copies of one member (3 members, 46+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java
Code Duplication · Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 650 findings
These 650 critical or serious findings were in the previous survey, on 24 October 2026, and are gone from this one. The first 100 are listed here.
Test Quality · No assertions: testMarkAsUnusedAllSegmentsInDataSourceBadRequest server/src/test/java/org/apache/druid/server/http/DataSourcesResourceTest.java
Test Quality · No assertions: testAuthenticatorNameWithWhitespaceIsInvalid server/src/test/java/org/apache/druid/server/security/AuthValidatorTest.java
Test Quality · No assertions: testAuthorizerNameStartsWithDotIsInValid server/src/test/java/org/apache/druid/server/security/AuthValidatorTest.java
Test Quality · No assertions: testAuthorizerNameWithEmptyIsInvalid server/src/test/java/org/apache/druid/server/security/AuthValidatorTest.java
Test Quality · No assertions: testAuthorizerNameWithNullIsInvalid server/src/test/java/org/apache/druid/server/security/AuthValidatorTest.java
Test Quality · No assertions: testAuthorizerNameWithSlashIsInvalid server/src/test/java/org/apache/druid/server/security/AuthValidatorTest.java
Test Quality · No assertions: testAuthorizerNameWithWhitespaceIsInvalid server/src/test/java/org/apache/druid/server/security/AuthValidatorTest.java
Test Quality · No assertions: testGetValidSegmentId_throwsException_withUnparseableId processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidEmojis processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidEmpty processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidLeadingDot processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidNull processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidSlashes processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidSpacesRegexCarriageReturn processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidSpacesRegexFormFeed processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidSpacesRegexLineTabulation processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidSpacesRegexNewline processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidSpacesRegexTabs processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testInvalidUnprintableChars processing/src/test/java/org/apache/druid/common/utils/IdUtilsTest.java
Test Quality · No assertions: testClosingWithoutWritingCreatesNoObject extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/output/RetryableS3OutputStreamTest.java
Test Quality · No assertions: testGroupByWithApproximateHistogramAgg extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramGroupByQueryTest.java
Test Quality · No assertions: testTopNWithApproximateHistogramAgg extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramTopNQueryTest.java
Test Quality · No assertions: testGroupByWithFixedHistogramAgg extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramGroupByQueryTest.java
Test Quality · No assertions: testTopNWithFixedHistogramAgg extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramTopNQueryTest.java
Test Quality · No assertions: testGroupBy extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceGroupByQueryTest.java
Test Quality · No assertions: testGroupByTestPvalueZscorePostAgg extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceGroupByQueryTest.java
Test Quality · No assertions: testGroupByVarianceOnly extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceGroupByQueryTest.java
Test Quality · No assertions: testGroupByZtestPostAgg extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceGroupByQueryTest.java
Test Quality · No assertions: testPostAggHavingSpec extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceGroupByQueryTest.java
Test Quality · No assertions: testTimeseriesQuery processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstTimeseriesQueryTest.java
Test Quality · No assertions: testTimeseriesQuery processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastTimeseriesQueryTest.java
Test Quality · No assertions: testAggregate processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferArrayGrouperTest.java
Test Quality · No assertions: testSimple processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouperTest.java
Rebuild cost: about €2,100,000 · Estimate
Cost to rebuild
€700,000 to €3,500,000, for 11,687 to 37,077 hours of work, about 14.5 person-years for 8 to 28 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 49. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 936,063 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 5 No assertions (empty test) finding(s) in Test Quality — start with RoaringBitmapIndexMergerV10Test.java (3), SegmentAllocationQueueTest.java, BlockingQueueOutputChannelFactoryTest.java.
Raises the score by about 3 points · Low effort · Test Quality
2
Resolve the 2 Banned license finding(s) in License Compliance.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €2,100,000 to build again, about 14.5 person-years of work. Its weakest lens is Accessibility, at 44 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 5 No assertions (empty test) finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 3 points for low effort, because it clears the 5 Test Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
1074 modules, with 4461 dependencies between them. 17 loops run through 277 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1034 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
java.util.common uses java.util.common.logger, so a change to java.util.common.logger can break java.util.common, while a change to java.util.common can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
2→32 java.util.emitter.service uses timelinepart of a loop✕
Connections
1 pair of types, where a type in java.util.emitter.service uses a type in timeline.
java.util.emitter.service uses timeline, so a change to timeline can break java.util.emitter.service, while a change to java.util.emitter.service can't break timeline.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→33 query.monomorphicprocessing uses java.util.common.loggerpart of a loop✕
Connections
1 pair of types, where a type in query.monomorphicprocessing uses a type in java.util.common.logger.
query.monomorphicprocessing uses java.util.common.logger, so a change to java.util.common.logger can break query.monomorphicprocessing, while a change to query.monomorphicprocessing can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→9 segment.vector uses segment.datapart of a loop✕
Connections
2 pairs of types, where a type in segment.vector uses a type in segment.data.
segment.vector uses segment.column, so a change to segment.column can break segment.vector, while a change to segment.vector can't break segment.column.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
4→11 segment.vector uses query.dimensionpart of a loop✕
Connections
4 pairs of types, where a type in segment.vector uses a type in query.dimension.
segment.vector uses query.dimension, so a change to query.dimension can break segment.vector, while a change to segment.vector can't break query.dimension.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
java.util.emitter uses java.util.emitter.service, so a change to java.util.emitter.service can break java.util.emitter, while a change to java.util.emitter can't break java.util.emitter.service.
Position
Below the diagonal: java.util.emitter uses a module listed above it, which is the healthy direction.
5→33 java.util.emitter uses java.util.common.loggerpart of a loop✕
Connections
1 pair of types, where a type in java.util.emitter uses a type in java.util.common.logger.
java.util.emitter uses java.util.common.logger, so a change to java.util.common.logger can break java.util.emitter, while a change to java.util.emitter can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
query.aggregation uses java.util.common, so a change to java.util.common can break query.aggregation, while a change to query.aggregation can't break java.util.common.
Position
Below the diagonal: query.aggregation uses a module listed above it, which is the healthy direction.
query.aggregation uses query.monomorphicprocessing, so a change to query.monomorphicprocessing can break query.aggregation, while a change to query.aggregation can't break query.monomorphicprocessing.
Position
Below the diagonal: query.aggregation uses a module listed above it, which is the healthy direction.
44 pairs of types, where a type in query.aggregation uses a type in segment.vector. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.aggregation uses segment.vector, so a change to segment.vector can break query.aggregation, while a change to query.aggregation can't break segment.vector.
Position
Below the diagonal: query.aggregation uses a module listed above it, which is the healthy direction.
6→7 query.aggregation uses segment.serdepart of a loop✕
Connections
8 pairs of types, where a type in query.aggregation uses a type in segment.serde.
query.aggregation uses segment.serde, so a change to segment.serde can break query.aggregation, while a change to query.aggregation can't break segment.serde.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→9 query.aggregation uses segment.datapart of a loop✕
Connections
9 pairs of types, where a type in query.aggregation uses a type in segment.data.
query.aggregation uses segment.data, so a change to segment.data can break query.aggregation, while a change to query.aggregation can't break segment.data.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→10 query.aggregation uses segment.columnpart of a loop✕
Connections
31 pairs of types, where a type in query.aggregation uses a type in segment.column. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.aggregation uses segment.column, so a change to segment.column can break query.aggregation, while a change to query.aggregation can't break segment.column.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→13 query.aggregation uses query.filterpart of a loop✕
Connections
4 pairs of types, where a type in query.aggregation uses a type in query.filter.
query.aggregation uses query.filter, so a change to query.filter can break query.aggregation, while a change to query.aggregation can't break query.filter.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→14 query.aggregation uses math.exprpart of a loop✕
Connections
30 pairs of types, where a type in query.aggregation uses a type in math.expr. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.aggregation uses initialization, so a change to initialization can break query.aggregation, while a change to query.aggregation can't break initialization.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→28 query.aggregation uses segmentpart of a loop✕
Connections
115 pairs of types, where a type in query.aggregation uses a type in segment. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
query.aggregation uses data.input.impl, so a change to data.input.impl can break query.aggregation, while a change to query.aggregation can't break data.input.impl.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→33 query.aggregation uses java.util.common.loggerpart of a loop✕
Connections
2 pairs of types, where a type in query.aggregation uses a type in java.util.common.logger.
query.aggregation uses java.util.common.logger, so a change to java.util.common.logger can break query.aggregation, while a change to query.aggregation can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
segment.serde uses query.aggregation, so a change to query.aggregation can break segment.serde, while a change to segment.serde can't break query.aggregation.
Position
Below the diagonal: segment.serde uses a module listed above it, which is the healthy direction.
7→9 segment.serde uses segment.datapart of a loop✕
Connections
31 pairs of types, where a type in segment.serde uses a type in segment.data. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.serde uses segment.data, so a change to segment.data can break segment.serde, while a change to segment.serde can't break segment.data.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→10 segment.serde uses segment.columnpart of a loop✕
Connections
38 pairs of types, where a type in segment.serde uses a type in segment.column. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.serde uses java.util.common.logger, so a change to java.util.common.logger can break segment.serde, while a change to segment.serde can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
server.security uses java.util.emitter.service, so a change to java.util.emitter.service can break server.security, while a change to server.security can't break java.util.emitter.service.
Position
Below the diagonal: server.security uses a module listed above it, which is the healthy direction.
server.security uses java.util.emitter, so a change to java.util.emitter can break server.security, while a change to server.security can't break java.util.emitter.
Position
Below the diagonal: server.security uses a module listed above it, which is the healthy direction.
server.security uses java.util.common.logger, so a change to java.util.common.logger can break server.security, while a change to server.security can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
segment.data uses java.util.common, so a change to java.util.common can break segment.data, while a change to segment.data can't break java.util.common.
Position
Below the diagonal: segment.data uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in segment.data uses a type in query.monomorphicprocessing. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.data uses query.monomorphicprocessing, so a change to query.monomorphicprocessing can break segment.data, while a change to segment.data can't break query.monomorphicprocessing.
Position
Below the diagonal: segment.data uses a module listed above it, which is the healthy direction.
35 pairs of types, where a type in segment.data uses a type in segment.serde. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.data uses java.util.common.logger, so a change to java.util.common.logger can break segment.data, while a change to segment.data can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
segment.column uses java.util.common, so a change to java.util.common can break segment.column, while a change to segment.column can't break java.util.common.
Position
Below the diagonal: segment.column uses a module listed above it, which is the healthy direction.
segment.column uses query.monomorphicprocessing, so a change to query.monomorphicprocessing can break segment.column, while a change to segment.column can't break query.monomorphicprocessing.
Position
Below the diagonal: segment.column uses a module listed above it, which is the healthy direction.
37 pairs of types, where a type in segment.column uses a type in segment.vector. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.column uses segment.vector, so a change to segment.vector can break segment.column, while a change to segment.column can't break segment.vector.
Position
Below the diagonal: segment.column uses a module listed above it, which is the healthy direction.
43 pairs of types, where a type in segment.column uses a type in segment.data. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.column uses data.input.impl, so a change to data.input.impl can break segment.column, while a change to segment.column can't break data.input.impl.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
query.dimension uses java.util.common, so a change to java.util.common can break query.dimension, while a change to query.dimension can't break java.util.common.
Position
Below the diagonal: query.dimension uses a module listed above it, which is the healthy direction.
query.dimension uses query.monomorphicprocessing, so a change to query.monomorphicprocessing can break query.dimension, while a change to query.dimension can't break query.monomorphicprocessing.
Position
Below the diagonal: query.dimension uses a module listed above it, which is the healthy direction.
query.dimension uses segment.vector, so a change to segment.vector can break query.dimension, while a change to query.dimension can't break segment.vector.
Position
Below the diagonal: query.dimension uses a module listed above it, which is the healthy direction.
query.dimension uses segment.column, so a change to segment.column can break query.dimension, while a change to query.dimension can't break segment.column.
Position
Below the diagonal: query.dimension uses a module listed above it, which is the healthy direction.
11→13 query.dimension uses query.filterpart of a loop✕
Connections
6 pairs of types, where a type in query.dimension uses a type in query.filter.
segment.loading uses java.util.common, so a change to java.util.common can break segment.loading, while a change to segment.loading can't break java.util.common.
Position
Below the diagonal: segment.loading uses a module listed above it, which is the healthy direction.
segment.loading uses java.util.emitter, so a change to java.util.emitter can break segment.loading, while a change to segment.loading can't break java.util.emitter.
Position
Below the diagonal: segment.loading uses a module listed above it, which is the healthy direction.
segment.loading uses segment.column, so a change to segment.column can break segment.loading, while a change to segment.loading can't break segment.column.
Position
Below the diagonal: segment.loading uses a module listed above it, which is the healthy direction.
33 pairs of types, where a type in segment.loading uses a type in segment. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.loading uses segment, so a change to segment can break segment.loading, while a change to segment.loading can't break segment.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→32 segment.loading uses timelinepart of a loop✕
Connections
36 pairs of types, where a type in segment.loading uses a type in timeline. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.loading uses java.util.common.logger, so a change to java.util.common.logger can break segment.loading, while a change to segment.loading can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
query.filter uses java.util.common, so a change to java.util.common can break query.filter, while a change to query.filter can't break java.util.common.
Position
Below the diagonal: query.filter uses a module listed above it, which is the healthy direction.
query.filter uses query.monomorphicprocessing, so a change to query.monomorphicprocessing can break query.filter, while a change to query.filter can't break query.monomorphicprocessing.
Position
Below the diagonal: query.filter uses a module listed above it, which is the healthy direction.
30 pairs of types, where a type in query.filter uses a type in segment. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
29 pairs of types, where a type in math.expr uses a type in segment.column. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
math.expr uses java.util.common.logger, so a change to java.util.common.logger can break math.expr, while a change to math.expr can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
java.util.common.granularity uses java.util.common, so a change to java.util.common can break java.util.common.granularity, while a change to java.util.common.granularity can't break java.util.common.
Position
Below the diagonal: java.util.common.granularity uses a module listed above it, which is the healthy direction.
java.util.common.granularity uses math.expr, so a change to math.expr can break java.util.common.granularity, while a change to java.util.common.granularity can't break math.expr.
Position
Below the diagonal: java.util.common.granularity uses a module listed above it, which is the healthy direction.
15→16 java.util.common.granularity uses querypart of a loop✕
Connections
1 pair of types, where a type in java.util.common.granularity uses a type in query.
java.util.common.granularity uses query, so a change to query can break java.util.common.granularity, while a change to java.util.common.granularity can't break query.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→28 java.util.common.granularity uses segmentpart of a loop✕
Connections
2 pairs of types, where a type in java.util.common.granularity uses a type in segment.
java.util.common.granularity uses segment, so a change to segment can break java.util.common.granularity, while a change to java.util.common.granularity can't break segment.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
query uses java.util.emitter.service, so a change to java.util.emitter.service can break query, while a change to query can't break java.util.emitter.service.
Position
Below the diagonal: query uses a module listed above it, which is the healthy direction.
query uses java.util.common.granularity, so a change to java.util.common.granularity can break query, while a change to query can't break java.util.common.granularity.
Position
Below the diagonal: query uses a module listed above it, which is the healthy direction.
query uses java.util.common.logger, so a change to java.util.common.logger can break query, while a change to query can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→35 query uses java.util.common.guavapart of a loop✕
Connections
25 pairs of types, where a type in query uses a type in java.util.common.guava.
segment.incremental uses query.monomorphicprocessing, so a change to query.monomorphicprocessing can break segment.incremental, while a change to segment.incremental can't break query.monomorphicprocessing.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
segment.incremental uses query.aggregation, so a change to query.aggregation can break segment.incremental, while a change to segment.incremental can't break query.aggregation.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
segment.incremental uses segment.data, so a change to segment.data can break segment.incremental, while a change to segment.incremental can't break segment.data.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in segment.incremental uses a type in segment.column. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.incremental uses segment.column, so a change to segment.column can break segment.incremental, while a change to segment.incremental can't break segment.column.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
segment.incremental uses query.dimension, so a change to query.dimension can break segment.incremental, while a change to segment.incremental can't break query.dimension.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
segment.incremental uses query.filter, so a change to query.filter can break segment.incremental, while a change to segment.incremental can't break query.filter.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
segment.incremental uses math.expr, so a change to math.expr can break segment.incremental, while a change to segment.incremental can't break math.expr.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
segment.incremental uses java.util.common.granularity, so a change to java.util.common.granularity can break segment.incremental, while a change to segment.incremental can't break java.util.common.granularity.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
segment.incremental uses query, so a change to query can break segment.incremental, while a change to segment.incremental can't break query.
Position
Below the diagonal: segment.incremental uses a module listed above it, which is the healthy direction.
17→28 segment.incremental uses segmentpart of a loop✕
Connections
78 pairs of types, where a type in segment.incremental uses a type in segment. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.incremental uses data.input, so a change to data.input can break segment.incremental, while a change to segment.incremental can't break data.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→31 segment.incremental uses data.input.implpart of a loop✕
Connections
14 pairs of types, where a type in segment.incremental uses a type in data.input.impl.
segment.incremental uses data.input.impl, so a change to data.input.impl can break segment.incremental, while a change to segment.incremental can't break data.input.impl.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→33 segment.incremental uses java.util.common.loggerpart of a loop✕
Connections
3 pairs of types, where a type in segment.incremental uses a type in java.util.common.logger.
segment.incremental uses java.util.common.logger, so a change to java.util.common.logger can break segment.incremental, while a change to segment.incremental can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
server.http uses java.util.emitter.service, so a change to java.util.emitter.service can break server.http, while a change to server.http can't break java.util.emitter.service.
Position
Below the diagonal: server.http uses a module listed above it, which is the healthy direction.
server.http uses java.util.emitter, so a change to java.util.emitter can break server.http, while a change to server.http can't break java.util.emitter.
Position
Below the diagonal: server.http uses a module listed above it, which is the healthy direction.
server.http uses server.coordinator, so a change to server.coordinator can break server.http, while a change to server.http can't break server.coordinator.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
server.http uses indexing.overlord, so a change to indexing.overlord can break server.http, while a change to server.http can't break indexing.overlord.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
server.http uses java.util.common.logger, so a change to java.util.common.logger can break server.http, while a change to server.http can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
server.coordinator uses java.util.emitter.service, so a change to java.util.emitter.service can break server.coordinator, while a change to server.coordinator can't break java.util.emitter.service.
Position
Below the diagonal: server.coordinator uses a module listed above it, which is the healthy direction.
server.coordinator uses java.util.emitter, so a change to java.util.emitter can break server.coordinator, while a change to server.coordinator can't break java.util.emitter.
Position
Below the diagonal: server.coordinator uses a module listed above it, which is the healthy direction.
server.coordinator uses query.aggregation, so a change to query.aggregation can break server.coordinator, while a change to server.coordinator can't break query.aggregation.
Position
Below the diagonal: server.coordinator uses a module listed above it, which is the healthy direction.
server.coordinator uses java.util.common.granularity, so a change to java.util.common.granularity can break server.coordinator, while a change to server.coordinator can't break java.util.common.granularity.
Position
Below the diagonal: server.coordinator uses a module listed above it, which is the healthy direction.
server.coordinator uses segment.incremental, so a change to segment.incremental can break server.coordinator, while a change to server.coordinator can't break segment.incremental.
Position
Below the diagonal: server.coordinator uses a module listed above it, which is the healthy direction.
server.coordinator uses server.http, so a change to server.http can break server.coordinator, while a change to server.coordinator can't break server.http.
Position
Below the diagonal: server.coordinator uses a module listed above it, which is the healthy direction.
19→22 server.coordinator uses metadatapart of a loop✕
Connections
5 pairs of types, where a type in server.coordinator uses a type in metadata.
server.coordinator uses indexing.overlord, so a change to indexing.overlord can break server.coordinator, while a change to server.coordinator can't break indexing.overlord.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→28 server.coordinator uses segmentpart of a loop✕
Connections
1 pair of types, where a type in server.coordinator uses a type in segment.
server.coordinator uses data.input, so a change to data.input can break server.coordinator, while a change to server.coordinator can't break data.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→31 server.coordinator uses data.input.implpart of a loop✕
Connections
7 pairs of types, where a type in server.coordinator uses a type in data.input.impl.
server.coordinator uses data.input.impl, so a change to data.input.impl can break server.coordinator, while a change to server.coordinator can't break data.input.impl.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→32 server.coordinator uses timelinepart of a loop✕
Connections
9 pairs of types, where a type in server.coordinator uses a type in timeline.
server.coordinator uses java.util.common.logger, so a change to java.util.common.logger can break server.coordinator, while a change to server.coordinator can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→36 server.coordinator uses discoverypart of a loop✕
Connections
2 pairs of types, where a type in server.coordinator uses a type in discovery.
server uses java.util.emitter.service, so a change to java.util.emitter.service can break server, while a change to server can't break java.util.emitter.service.
Position
Below the diagonal: server uses a module listed above it, which is the healthy direction.
server uses java.util.common.logger, so a change to java.util.common.logger can break server, while a change to server can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→35 server uses java.util.common.guavapart of a loop✕
Connections
9 pairs of types, where a type in server uses a type in java.util.common.guava.
server uses java.util.common.guava, so a change to java.util.common.guava can break server, while a change to server can't break java.util.common.guava.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
segment.realtime.appenderator uses java.util.common, so a change to java.util.common can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break java.util.common.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
segment.realtime.appenderator uses java.util.emitter.service, so a change to java.util.emitter.service can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break java.util.emitter.service.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
segment.realtime.appenderator uses java.util.emitter, so a change to java.util.emitter can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break java.util.emitter.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
segment.realtime.appenderator uses query.aggregation, so a change to query.aggregation can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break query.aggregation.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
segment.realtime.appenderator uses segment.column, so a change to segment.column can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break segment.column.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
segment.realtime.appenderator uses segment.loading, so a change to segment.loading can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break segment.loading.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
43 pairs of types, where a type in segment.realtime.appenderator uses a type in query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.realtime.appenderator uses query, so a change to query can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break query.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
segment.realtime.appenderator uses segment.incremental, so a change to segment.incremental can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break segment.incremental.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
segment.realtime.appenderator uses server, so a change to server can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break server.
Position
Below the diagonal: segment.realtime.appenderator uses a module listed above it, which is the healthy direction.
21→22 segment.realtime.appenderator uses metadatapart of a loop✕
Connections
1 pair of types, where a type in segment.realtime.appenderator uses a type in metadata.
segment.realtime.appenderator uses metadata, so a change to metadata can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break metadata.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→23 segment.realtime.appenderator uses indexing.overlordpart of a loop✕
Connections
1 pair of types, where a type in segment.realtime.appenderator uses a type in indexing.overlord.
segment.realtime.appenderator uses indexing.overlord, so a change to indexing.overlord can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break indexing.overlord.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→28 segment.realtime.appenderator uses segmentpart of a loop✕
Connections
29 pairs of types, where a type in segment.realtime.appenderator uses a type in segment. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment.realtime.appenderator uses segment, so a change to segment can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break segment.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→29 segment.realtime.appenderator uses data.inputpart of a loop✕
Connections
13 pairs of types, where a type in segment.realtime.appenderator uses a type in data.input.
segment.realtime.appenderator uses data.input, so a change to data.input can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break data.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→31 segment.realtime.appenderator uses data.input.implpart of a loop✕
Connections
1 pair of types, where a type in segment.realtime.appenderator uses a type in data.input.impl.
segment.realtime.appenderator uses data.input.impl, so a change to data.input.impl can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break data.input.impl.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→32 segment.realtime.appenderator uses timelinepart of a loop✕
Connections
17 pairs of types, where a type in segment.realtime.appenderator uses a type in timeline.
segment.realtime.appenderator uses timeline, so a change to timeline can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break timeline.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→33 segment.realtime.appenderator uses java.util.common.loggerpart of a loop✕
Connections
4 pairs of types, where a type in segment.realtime.appenderator uses a type in java.util.common.logger.
segment.realtime.appenderator uses java.util.common.logger, so a change to java.util.common.logger can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→35 segment.realtime.appenderator uses java.util.common.guavapart of a loop✕
Connections
2 pairs of types, where a type in segment.realtime.appenderator uses a type in java.util.common.guava.
segment.realtime.appenderator uses java.util.common.guava, so a change to java.util.common.guava can break segment.realtime.appenderator, while a change to segment.realtime.appenderator can't break java.util.common.guava.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
metadata uses java.util.emitter.service, so a change to java.util.emitter.service can break metadata, while a change to metadata can't break java.util.emitter.service.
Position
Below the diagonal: metadata uses a module listed above it, which is the healthy direction.
metadata uses segment.realtime.appenderator, so a change to segment.realtime.appenderator can break metadata, while a change to metadata can't break segment.realtime.appenderator.
Position
Below the diagonal: metadata uses a module listed above it, which is the healthy direction.
22→23 metadata uses indexing.overlordpart of a loop✕
Connections
6 pairs of types, where a type in metadata uses a type in indexing.overlord.
metadata uses indexing.common.task, so a change to indexing.common.task can break metadata, while a change to metadata can't break indexing.common.task.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
metadata uses java.util.common.logger, so a change to java.util.common.logger can break metadata, while a change to metadata can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
indexing.overlord uses java.util.common, so a change to java.util.common can break indexing.overlord, while a change to indexing.overlord can't break java.util.common.
Position
Below the diagonal: indexing.overlord uses a module listed above it, which is the healthy direction.
indexing.overlord uses java.util.emitter.service, so a change to java.util.emitter.service can break indexing.overlord, while a change to indexing.overlord can't break java.util.emitter.service.
Position
Below the diagonal: indexing.overlord uses a module listed above it, which is the healthy direction.
indexing.overlord uses java.util.emitter, so a change to java.util.emitter can break indexing.overlord, while a change to indexing.overlord can't break java.util.emitter.
Position
Below the diagonal: indexing.overlord uses a module listed above it, which is the healthy direction.
indexing.overlord uses server.http, so a change to server.http can break indexing.overlord, while a change to indexing.overlord can't break server.http.
Position
Below the diagonal: indexing.overlord uses a module listed above it, which is the healthy direction.
indexing.overlord uses segment.realtime.appenderator, so a change to segment.realtime.appenderator can break indexing.overlord, while a change to indexing.overlord can't break segment.realtime.appenderator.
Position
Below the diagonal: indexing.overlord uses a module listed above it, which is the healthy direction.
indexing.overlord uses metadata, so a change to metadata can break indexing.overlord, while a change to indexing.overlord can't break metadata.
Position
Below the diagonal: indexing.overlord uses a module listed above it, which is the healthy direction.
23→24 indexing.overlord uses indexing.commonpart of a loop✕
Connections
33 pairs of types, where a type in indexing.overlord uses a type in indexing.common. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
indexing.overlord uses indexing.common, so a change to indexing.common can break indexing.overlord, while a change to indexing.overlord can't break indexing.common.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→25 indexing.overlord uses indexing.common.taskpart of a loop✕
Connections
31 pairs of types, where a type in indexing.overlord uses a type in indexing.common.task. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
indexing.overlord uses indexing.common.task, so a change to indexing.common.task can break indexing.overlord, while a change to indexing.overlord can't break indexing.common.task.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→28 indexing.overlord uses segmentpart of a loop✕
Connections
1 pair of types, where a type in indexing.overlord uses a type in segment.
indexing.overlord uses java.util.common.logger, so a change to java.util.common.logger can break indexing.overlord, while a change to indexing.overlord can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→36 indexing.overlord uses discoverypart of a loop✕
Connections
3 pairs of types, where a type in indexing.overlord uses a type in discovery.
indexing.common uses java.util.emitter.service, so a change to java.util.emitter.service can break indexing.common, while a change to indexing.common can't break java.util.emitter.service.
Position
Below the diagonal: indexing.common uses a module listed above it, which is the healthy direction.
indexing.common uses server.security, so a change to server.security can break indexing.common, while a change to indexing.common can't break server.security.
Position
Below the diagonal: indexing.common uses a module listed above it, which is the healthy direction.
indexing.common uses segment.loading, so a change to segment.loading can break indexing.common, while a change to indexing.common can't break segment.loading.
Position
Below the diagonal: indexing.common uses a module listed above it, which is the healthy direction.
indexing.common uses segment.incremental, so a change to segment.incremental can break indexing.common, while a change to indexing.common can't break segment.incremental.
Position
Below the diagonal: indexing.common uses a module listed above it, which is the healthy direction.
indexing.common uses segment.realtime.appenderator, so a change to segment.realtime.appenderator can break indexing.common, while a change to indexing.common can't break segment.realtime.appenderator.
Position
Below the diagonal: indexing.common uses a module listed above it, which is the healthy direction.
indexing.common uses indexing.overlord, so a change to indexing.overlord can break indexing.common, while a change to indexing.common can't break indexing.overlord.
Position
Below the diagonal: indexing.common uses a module listed above it, which is the healthy direction.
24→25 indexing.common uses indexing.common.taskpart of a loop✕
Connections
1 pair of types, where a type in indexing.common uses a type in indexing.common.task.
indexing.common uses indexing.common.task, so a change to indexing.common.task can break indexing.common, while a change to indexing.common can't break indexing.common.task.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
indexing.common uses java.util.common.logger, so a change to java.util.common.logger can break indexing.common, while a change to indexing.common can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→36 indexing.common uses discoverypart of a loop✕
Connections
9 pairs of types, where a type in indexing.common uses a type in discovery.
indexing.common.task uses java.util.common, so a change to java.util.common can break indexing.common.task, while a change to indexing.common.task can't break java.util.common.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses java.util.emitter.service, so a change to java.util.emitter.service can break indexing.common.task, while a change to indexing.common.task can't break java.util.emitter.service.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses query.aggregation, so a change to query.aggregation can break indexing.common.task, while a change to indexing.common.task can't break query.aggregation.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses server.security, so a change to server.security can break indexing.common.task, while a change to indexing.common.task can't break server.security.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses segment.loading, so a change to segment.loading can break indexing.common.task, while a change to indexing.common.task can't break segment.loading.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses java.util.common.granularity, so a change to java.util.common.granularity can break indexing.common.task, while a change to indexing.common.task can't break java.util.common.granularity.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses segment.incremental, so a change to segment.incremental can break indexing.common.task, while a change to indexing.common.task can't break segment.incremental.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses server.http, so a change to server.http can break indexing.common.task, while a change to indexing.common.task can't break server.http.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses server.coordinator, so a change to server.coordinator can break indexing.common.task, while a change to indexing.common.task can't break server.coordinator.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses segment.realtime.appenderator, so a change to segment.realtime.appenderator can break indexing.common.task, while a change to indexing.common.task can't break segment.realtime.appenderator.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses metadata, so a change to metadata can break indexing.common.task, while a change to indexing.common.task can't break metadata.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
indexing.common.task uses indexing.overlord, so a change to indexing.overlord can break indexing.common.task, while a change to indexing.common.task can't break indexing.overlord.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
40 pairs of types, where a type in indexing.common.task uses a type in indexing.common. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
indexing.common.task uses indexing.common, so a change to indexing.common can break indexing.common.task, while a change to indexing.common.task can't break indexing.common.
Position
Below the diagonal: indexing.common.task uses a module listed above it, which is the healthy direction.
25→26 indexing.common.task uses guicepart of a loop✕
Connections
1 pair of types, where a type in indexing.common.task uses a type in guice.
indexing.common.task uses data.input, so a change to data.input can break indexing.common.task, while a change to indexing.common.task can't break data.input.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→31 indexing.common.task uses data.input.implpart of a loop✕
Connections
10 pairs of types, where a type in indexing.common.task uses a type in data.input.impl.
indexing.common.task uses data.input.impl, so a change to data.input.impl can break indexing.common.task, while a change to indexing.common.task can't break data.input.impl.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→32 indexing.common.task uses timelinepart of a loop✕
Connections
16 pairs of types, where a type in indexing.common.task uses a type in timeline.
indexing.common.task uses timeline, so a change to timeline can break indexing.common.task, while a change to indexing.common.task can't break timeline.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→33 indexing.common.task uses java.util.common.loggerpart of a loop✕
Connections
11 pairs of types, where a type in indexing.common.task uses a type in java.util.common.logger.
indexing.common.task uses java.util.common.logger, so a change to java.util.common.logger can break indexing.common.task, while a change to indexing.common.task can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
guice uses java.util.common.logger, so a change to java.util.common.logger can break guice, while a change to guice can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
initialization uses java.util.common.logger, so a change to java.util.common.logger can break initialization, while a change to initialization can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
27→36 initialization uses discoverypart of a loop✕
Connections
2 pairs of types, where a type in initialization uses a type in discovery.
37 pairs of types, where a type in segment uses a type in query.monomorphicprocessing. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment uses query.monomorphicprocessing, so a change to query.monomorphicprocessing can break segment, while a change to segment can't break query.monomorphicprocessing.
Position
Below the diagonal: segment uses a module listed above it, which is the healthy direction.
30 pairs of types, where a type in segment uses a type in segment.vector. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
95 pairs of types, where a type in segment uses a type in segment.data. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
128 pairs of types, where a type in segment uses a type in segment.column. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
44 pairs of types, where a type in segment uses a type in query.filter. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
segment uses java.util.common.granularity, so a change to java.util.common.granularity can break segment, while a change to segment can't break java.util.common.granularity.
Position
Below the diagonal: segment uses a module listed above it, which is the healthy direction.
segment uses java.util.common.logger, so a change to java.util.common.logger can break segment, while a change to segment can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
28→35 segment uses java.util.common.guavapart of a loop✕
Connections
4 pairs of types, where a type in segment uses a type in java.util.common.guava.
segment uses java.util.common.guava, so a change to java.util.common.guava can break segment, while a change to segment can't break java.util.common.guava.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
data.input uses java.util.common.logger, so a change to java.util.common.logger can break data.input, while a change to data.input can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
sql.calcite.rel uses java.util.common, so a change to java.util.common can break sql.calcite.rel, while a change to sql.calcite.rel can't break java.util.common.
Position
Below the diagonal: sql.calcite.rel uses a module listed above it, which is the healthy direction.
sql.calcite.rel uses query.aggregation, so a change to query.aggregation can break sql.calcite.rel, while a change to sql.calcite.rel can't break query.aggregation.
Position
Below the diagonal: sql.calcite.rel uses a module listed above it, which is the healthy direction.
sql.calcite.rel uses segment.column, so a change to segment.column can break sql.calcite.rel, while a change to sql.calcite.rel can't break segment.column.
Position
Below the diagonal: sql.calcite.rel uses a module listed above it, which is the healthy direction.
sql.calcite.rel uses query.dimension, so a change to query.dimension can break sql.calcite.rel, while a change to sql.calcite.rel can't break query.dimension.
Position
Below the diagonal: sql.calcite.rel uses a module listed above it, which is the healthy direction.
sql.calcite.rel uses java.util.common.granularity, so a change to java.util.common.granularity can break sql.calcite.rel, while a change to sql.calcite.rel can't break java.util.common.granularity.
Position
Below the diagonal: sql.calcite.rel uses a module listed above it, which is the healthy direction.
sql.calcite.rel uses sql.calcite.planner, so a change to sql.calcite.planner can break sql.calcite.rel, while a change to sql.calcite.rel can't break sql.calcite.planner.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
data.input.impl uses java.util.emitter, so a change to java.util.emitter can break data.input.impl, while a change to data.input.impl can't break java.util.emitter.
Position
Below the diagonal: data.input.impl uses a module listed above it, which is the healthy direction.
data.input.impl uses query.aggregation, so a change to query.aggregation can break data.input.impl, while a change to data.input.impl can't break query.aggregation.
Position
Below the diagonal: data.input.impl uses a module listed above it, which is the healthy direction.
data.input.impl uses segment.column, so a change to segment.column can break data.input.impl, while a change to data.input.impl can't break segment.column.
Position
Below the diagonal: data.input.impl uses a module listed above it, which is the healthy direction.
data.input.impl uses java.util.common.granularity, so a change to java.util.common.granularity can break data.input.impl, while a change to data.input.impl can't break java.util.common.granularity.
Position
Below the diagonal: data.input.impl uses a module listed above it, which is the healthy direction.
100 pairs of types, where a type in data.input.impl uses a type in data.input. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
data.input.impl uses java.util.common.logger, so a change to java.util.common.logger can break data.input.impl, while a change to data.input.impl can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
timeline uses java.util.common.logger, so a change to java.util.common.logger can break timeline, while a change to timeline can't break java.util.common.logger.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
java.util.common.logger uses timeline, so a change to timeline can break java.util.common.logger, while a change to java.util.common.logger can't break timeline.
Position
Below the diagonal: java.util.common.logger uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses java.util.common, so a change to java.util.common can break indexing.seekablestream, while a change to indexing.seekablestream can't break java.util.common.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses java.util.emitter.service, so a change to java.util.emitter.service can break indexing.seekablestream, while a change to indexing.seekablestream can't break java.util.emitter.service.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses java.util.emitter, so a change to java.util.emitter can break indexing.seekablestream, while a change to indexing.seekablestream can't break java.util.emitter.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses server.security, so a change to server.security can break indexing.seekablestream, while a change to indexing.seekablestream can't break server.security.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses query, so a change to query can break indexing.seekablestream, while a change to indexing.seekablestream can't break query.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses segment.incremental, so a change to segment.incremental can break indexing.seekablestream, while a change to indexing.seekablestream can't break segment.incremental.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses segment.realtime.appenderator, so a change to segment.realtime.appenderator can break indexing.seekablestream, while a change to indexing.seekablestream can't break segment.realtime.appenderator.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses metadata, so a change to metadata can break indexing.seekablestream, while a change to indexing.seekablestream can't break metadata.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses indexing.overlord, so a change to indexing.overlord can break indexing.seekablestream, while a change to indexing.seekablestream can't break indexing.overlord.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses indexing.common, so a change to indexing.common can break indexing.seekablestream, while a change to indexing.seekablestream can't break indexing.common.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses indexing.common.task, so a change to indexing.common.task can break indexing.seekablestream, while a change to indexing.seekablestream can't break indexing.common.task.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses guice, so a change to guice can break indexing.seekablestream, while a change to indexing.seekablestream can't break guice.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses segment, so a change to segment can break indexing.seekablestream, while a change to indexing.seekablestream can't break segment.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in indexing.seekablestream uses a type in data.input. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
indexing.seekablestream uses data.input, so a change to data.input can break indexing.seekablestream, while a change to indexing.seekablestream can't break data.input.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses data.input.impl, so a change to data.input.impl can break indexing.seekablestream, while a change to indexing.seekablestream can't break data.input.impl.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses timeline, so a change to timeline can break indexing.seekablestream, while a change to indexing.seekablestream can't break timeline.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
indexing.seekablestream uses java.util.common.logger, so a change to java.util.common.logger can break indexing.seekablestream, while a change to indexing.seekablestream can't break java.util.common.logger.
Position
Below the diagonal: indexing.seekablestream uses a module listed above it, which is the healthy direction.
java.util.common.guava uses java.util.common.logger, so a change to java.util.common.logger can break java.util.common.guava, while a change to java.util.common.guava can't break java.util.common.logger.
Position
Below the diagonal: java.util.common.guava uses a module listed above it, which is the healthy direction.
discovery uses java.util.common.logger, so a change to java.util.common.logger can break discovery, while a change to discovery can't break java.util.common.logger.
Position
Below the diagonal: discovery uses a module listed above it, which is the healthy direction.
discovery uses java.util.common.guava, so a change to java.util.common.guava can break discovery, while a change to discovery can't break java.util.common.guava.
Position
Below the diagonal: discovery uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses java.util.common, so a change to java.util.common can break sql.calcite.planner, while a change to sql.calcite.planner can't break java.util.common.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses java.util.emitter, so a change to java.util.emitter can break sql.calcite.planner, while a change to sql.calcite.planner can't break java.util.emitter.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses query.aggregation, so a change to query.aggregation can break sql.calcite.planner, while a change to sql.calcite.planner can't break query.aggregation.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses server.security, so a change to server.security can break sql.calcite.planner, while a change to sql.calcite.planner can't break server.security.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses segment.column, so a change to segment.column can break sql.calcite.planner, while a change to sql.calcite.planner can't break segment.column.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses query.dimension, so a change to query.dimension can break sql.calcite.planner, while a change to sql.calcite.planner can't break query.dimension.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses query.filter, so a change to query.filter can break sql.calcite.planner, while a change to sql.calcite.planner can't break query.filter.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses math.expr, so a change to math.expr can break sql.calcite.planner, while a change to sql.calcite.planner can't break math.expr.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses java.util.common.granularity, so a change to java.util.common.granularity can break sql.calcite.planner, while a change to sql.calcite.planner can't break java.util.common.granularity.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses sql.calcite.rel, so a change to sql.calcite.rel can break sql.calcite.planner, while a change to sql.calcite.planner can't break sql.calcite.rel.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses data.input.impl, so a change to data.input.impl can break sql.calcite.planner, while a change to sql.calcite.planner can't break data.input.impl.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses java.util.common.logger, so a change to java.util.common.logger can break sql.calcite.planner, while a change to sql.calcite.planner can't break java.util.common.logger.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
sql.calcite.planner uses java.util.common.guava, so a change to java.util.common.guava can break sql.calcite.planner, while a change to sql.calcite.planner can't break java.util.common.guava.
Position
Below the diagonal: sql.calcite.planner uses a module listed above it, which is the healthy direction.
client uses java.util.emitter.service, so a change to java.util.emitter.service can break client, while a change to client can't break java.util.emitter.service.
Position
Below the diagonal: client uses a module listed above it, which is the healthy direction.
client uses segment.realtime.appenderator, so a change to segment.realtime.appenderator can break client, while a change to client can't break segment.realtime.appenderator.
Position
Below the diagonal: client uses a module listed above it, which is the healthy direction.
client uses java.util.common.logger, so a change to java.util.common.logger can break client, while a change to client can't break java.util.common.logger.
Position
Below the diagonal: client uses a module listed above it, which is the healthy direction.
client uses java.util.common.guava, so a change to java.util.common.guava can break client, while a change to client can't break java.util.common.guava.
Position
Below the diagonal: client uses a module listed above it, which is the healthy direction.
msq.indexing uses java.util.common.granularity, so a change to java.util.common.granularity can break msq.indexing, while a change to msq.indexing can't break java.util.common.granularity.
Position
Below the diagonal: msq.indexing uses a module listed above it, which is the healthy direction.
msq.indexing uses segment.incremental, so a change to segment.incremental can break msq.indexing, while a change to msq.indexing can't break segment.incremental.
Position
Below the diagonal: msq.indexing uses a module listed above it, which is the healthy direction.
msq.indexing uses server.coordinator, so a change to server.coordinator can break msq.indexing, while a change to msq.indexing can't break server.coordinator.
Position
Below the diagonal: msq.indexing uses a module listed above it, which is the healthy direction.
msq.indexing uses segment.realtime.appenderator, so a change to segment.realtime.appenderator can break msq.indexing, while a change to msq.indexing can't break segment.realtime.appenderator.
Position
Below the diagonal: msq.indexing uses a module listed above it, which is the healthy direction.
msq.indexing uses indexing.common.task, so a change to indexing.common.task can break msq.indexing, while a change to msq.indexing can't break indexing.common.task.
Position
Below the diagonal: msq.indexing uses a module listed above it, which is the healthy direction.
msq.indexing uses java.util.common.logger, so a change to java.util.common.logger can break msq.indexing, while a change to msq.indexing can't break java.util.common.logger.
Position
Below the diagonal: msq.indexing uses a module listed above it, which is the healthy direction.
msq.indexing uses java.util.common.guava, so a change to java.util.common.guava can break msq.indexing, while a change to msq.indexing can't break java.util.common.guava.
Position
Below the diagonal: msq.indexing uses a module listed above it, which is the healthy direction.
msq.indexing uses sql.calcite.planner, so a change to sql.calcite.planner can break msq.indexing, while a change to msq.indexing can't break sql.calcite.planner.
Position
Below the diagonal: msq.indexing uses a module listed above it, which is the healthy direction.
43 pairs of types, where a type in msq.indexing uses a type in msq.exec. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
msq.exec uses java.util.emitter.service, so a change to java.util.emitter.service can break msq.exec, while a change to msq.exec can't break java.util.emitter.service.
Position
Below the diagonal: msq.exec uses a module listed above it, which is the healthy direction.
msq.exec uses java.util.common.granularity, so a change to java.util.common.granularity can break msq.exec, while a change to msq.exec can't break java.util.common.granularity.
Position
Below the diagonal: msq.exec uses a module listed above it, which is the healthy direction.
msq.exec uses segment.realtime.appenderator, so a change to segment.realtime.appenderator can break msq.exec, while a change to msq.exec can't break segment.realtime.appenderator.
Position
Below the diagonal: msq.exec uses a module listed above it, which is the healthy direction.
msq.exec uses indexing.common.task, so a change to indexing.common.task can break msq.exec, while a change to msq.exec can't break indexing.common.task.
Position
Below the diagonal: msq.exec uses a module listed above it, which is the healthy direction.
msq.exec uses java.util.common.logger, so a change to java.util.common.logger can break msq.exec, while a change to msq.exec can't break java.util.common.logger.
Position
Below the diagonal: msq.exec uses a module listed above it, which is the healthy direction.
msq.exec uses java.util.common.guava, so a change to java.util.common.guava can break msq.exec, while a change to msq.exec can't break java.util.common.guava.
Position
Below the diagonal: msq.exec uses a module listed above it, which is the healthy direction.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
40
High / Critical
A02:2025 — Security Misconfiguration
12
High / Critical
A03:2025 — Software Supply Chain Failures
9
High / Critical
A07:2025 — Authentication Failures
2
High / Critical
Roadmap
Top priorities: Resolve the 5 No assertions (empty test) finding(s) in Test Quality — start with RoaringBitmapIndexMergerV10Test.java (3), SegmentAllocationQueueTest.java, BlockingQueueOutputChannelFactoryTest.java; Resolve the 2 Banned license finding(s) in License Compliance; Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 5 No assertions (empty test) finding(s) in Test Quality — start with RoaringBitmapIndexMergerV10Test.java (3), SegmentAllocationQueueTest.java, BlockingQueueOutputChannelFactoryTest.java.
Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 92
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 5474
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 3517
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 18
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 80 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 80 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 9045 of 9083 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .ts, .tsx, .java, and our analyzer cannot run the .java test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 63.7% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 22,988 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 191 test source file(s) (.tsx, .ts) that it cannot: it reads the test types the .java frontend declared, so a suite in any other language is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .java, and the jvm executor ran against the .java half and could not be re-run to completion inside our analyzer environment — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (jest via `npm ci --ignore-scripts` in web-console/ (422 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The remedy is our analyzer environment, not a runner nobody has built.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — a Maven build resolved 131 artifact(s) (47 behind a shipped release, reported), but the build resolved only part of the graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its JVM dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (sql/pom.xml), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
D23 Boundary Type-Coupling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind measured 0/40 valid on a seeded held-out sample of its rows on 98 C# repositories (docs/plans/deterministic-engine/adjudication/P5c-D23-units.md, "Version 1 ON MAIN"): the noise rows were dependencies on layer folders, shared cores and grouping folders read as contexts. By the pre-registered fallback (PREREGISTRATION v37) it publishes no row until version 4 passes its gate. The candidates are counted here, not reported as findings, and the score does not include them.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java`, `processing/src/main/java/org/apache/druid/query/context/docs/ParameterDocumentationGenerator.java`, `server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java`, `server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java`, `sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemQueryContextParametersTable.java` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is Guice, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (examples/quickstart/tutorial/hadoop/docker/Dockerfile). docker build failed (exit 1) — -------------------- ERROR: failed to solve: process "/bin/sh -c yum clean all && rpm --rebuilddb && yum install -y curl which tar sudo openssh-server openssh-clients rsync yum-plugin-ovl && yum clean all && yum update -y libselinux && yum update -y nss && yum clean all" did not complete successfully: exit code: 1; runtime evidence skipped.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Java, Python, r is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 131 further occurrence(s) are not listed individually; the score already reflects all 171.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P8 Schema migrations — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 120 further occurrence(s) are not listed individually; the score already reflects all 160.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 55 further occurrence(s) are not listed individually; the score already reflects all 95.
R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 53 further occurrence(s) are not listed individually; the score already reflects all 93.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 130 further occurrence(s) are not listed individually; the score already reflects all 170.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 3 further occurrence(s) are not listed individually; the score already reflects all 43.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
271 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was schema-step.SchemaStep at 98. A further 22 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being types.dataTypeToIcon at 39 — they are counted neither in the figure above nor in this dimension's score. 12 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: web-console/src/utils/types.ts (types.dataTypeToIcon at 39), web-console/src/views/supervisors-view/supervisors-view.tsx (SupervisorsView.constructor at 21), processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java (SimdProcessors.makeDoubleUnary at 19), sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java (Calcites.sqlTypeNameJdbcToJavaClass at 19), sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSqlEngine.java (ProjectionSqlEngine.featureAvailable at 19), and 7 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 266 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 8 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with schema-step.SchemaStep (cyclomatic 98), segment-bar-chart-render.SegmentBarChartRender (cyclomatic 94), continuous-chart-render.ContinuousChartRender (cyclomatic 75). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cyclomatic Complexity from 6.0 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 722 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 120 down to 120 or less in Cognitive Complexity — start with SeekableStreamIndexTaskRunner.runInternal (cognitive 138), DruidRexExecutor.reduce (cognitive 122). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cognitive Complexity from 5.7 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.6 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 129 ClassTooLong finding(s) in God Classes — start with SeekableStreamSupervisor.java, load-data-view.tsx, Function.java. — One of this dimension's main actionable groups (129 warning-level).
Resolve the 114 FileTooLong finding(s) in God Classes — start with SeekableStreamSupervisor.java, load-data-view.tsx, Function.java. — One of this dimension's main actionable groups (114 warning-level).
Resolve the 107 TooManyMethods finding(s) in God Classes — start with GroupByQuery.java (2), TaskToolbox.java (2), IndexTask.java (2). — One of this dimension's main actionable groups (107 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
1106 duplicated block group(s) detected. A further 1181 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 396 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 85 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with FrontCodedIndexedWriter.java (3), Function.java (3), ForkingTaskRunner.java (2). — One of this dimension's main actionable groups (85 warning-level).
Resolve the 75 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with Function.java (2), DoubleFirstAggregatorFactory.java (2), VSizeLongSerde.java (2). — One of this dimension's main actionable groups (75 warning-level).
Resolve the 65 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with CoordinatorBasicAuthorizerMetadataStorageUpdater.java (2), BottomUpTransform.java (2), SimpleVectorMathUnivariateDoubleProcessorFactory.java (2). — One of this dimension's main actionable groups (65 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.5 / 10Stronggated by 5 serious findings✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
79 production modules (Maven+npm), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 5 module(s) off the main sequence, with abstractness counted on 77 of the 79 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: druid-processing · ×4
Unstable project druid-testing-tools
Off the main sequence: druid-aws-common
What to do
Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 Unstable project druid-testing-tools finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 15 Low cohesion finding(s) in Cohesion (LCOM4) — start with HeapMemoryDatasourceSegmentCache.java, FlattenJSONBenchmarkUtil.java, DruidConnection.java. — One of this dimension's main actionable groups (15 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality9.2 / 10Adequategated by 5 critical findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
143 skipped (143 with a documented reason), 3660 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 22988 tests (1 harness-style project(s) excluded from the assertion penalty). Measured on the .java suite only — at least 191 test source file(s) (.tsx, .ts) went unread, so its test quality is unmeasured and is not in these counts.
No assertions (empty test): testMaxWaitTime · ×5indexing-service/src/test/java/org/apache/druid/indexing/common/actions/SegmentAllocationQueueTest.java:335
No assertions: testRunSkipIfLastRunLessThanPeriod · ×1217server/src/test/java/org/apache/druid/server/coordinator/duty/KillAuditLogTest.java:64
No direct assertions: testInvokeSegmentSchemaAnnounced · ×2438sql/src/test/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheTest.java:1333
Resolve the 5 No assertions (empty test) finding(s) in Test Quality — start with RoaringBitmapIndexMergerV10Test.java (3), SegmentAllocationQueueTest.java, BlockingQueueOutputChannelFactoryTest.java. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 2438 No direct assertions finding(s) in Test Quality — start with DrillWindowQueryTest.java (1035), CalciteQueryTest.java (429), CalciteNestedDataQueryTest.java (179). — One of this dimension's main actionable groups (2438 recommendation-level).
Resolve the 1217 No assertions finding(s) in Test Quality — start with TopNQueryRunnerTest.java (118), MSQInsertTest.java (57), MSQSelectTest.java (51). — One of this dimension's main actionable groups (1217 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
REDACTED scan ran and found no leaked secrets. 1 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.
What it measures: Whether the REDACTED of third-party packages are compatible with your policy.
Method: Third-party package REDACTED resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
2 of 70 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 81 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. 1960 further coordinate(s) are declared with no version at the declaration site — inherited from a parent POM, a BOM or an unresolved Gradle version reference — and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. 2 of them resolve to no licence at all on Central, even through their parent POMs; that is missing data, not a violation, and none of them is charged. A further 4 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's JVM dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
Banned license: org.openjdk.jmh:jmh-core · ×2
What to do
Resolve the 2 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java (7×71=497); web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx (4×106=424); distribution/bin/check-licenses.py (9×44=396) Repeated repair below the complexity floor: processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java (3 of 5 changes were fixes); server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java (3 of 4 changes were fixes); server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java (3 of 3 changes were fixes)
Resolve the 26 Hotspot finding(s) in Churn × Complexity Hotspots — start with SeekableStreamIndexTaskRunner.java, execution-stages-pane.tsx, check-licenses.py. — One of this dimension's main actionable groups (26 warning-level).
Resolve the 3 Repeated repair finding(s) in Churn × Complexity Hotspots — start with PartialSegmentFileMapperV10.java, DruidCoordinator.java, StorageLocation.java. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.4 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
177 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is web-console/src/views/datasources-view/datasources-view.tsx. Counted over 2870 of the 6354 production source files in this repository: 3354 are under the ~2,400-byte size floor this dimension measures over, and the remaining 130 have no attributable history left to measure.
Off-boarding risk: anonymized user #1 · ×9
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
53 deducted task-comment markers across 936063 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 46 TodoComment finding(s) in Explicit Debt — start with SchemaRegistryImpl.java (3), CachedMetadataCatalog.java (3), CalciteJoinQueryTest.java (2). — One of this dimension's main actionable groups (46 warning-level).
Resolve the 7 HackComment finding(s) in Explicit Debt — start with sampler.ts (2), TestHelper.java (2), NativeQueryMaker.java. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 290 document(s) read across 3 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.
Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.
Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
doc comments repeat the namesweb-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:455
What to do
Resolve the 6 redundant comment finding(s) in Comment Value — start with doctor-checks.tsx (2), input-format-completions.ts (2), dart-query-entry.ts. — One of this dimension's main actionable groups (6 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
8 of 80 build units (Maven, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
84 % of calls cross a namespace and 15 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
40 finding(s): 0 critical, 28 high, 8 medium, 4 low. 21 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 13 file(s) — `examples/bin/node.sh` (lines 57–107), `examples/quickstart/tutorial/rollup-data.json`, `examples/quickstart/tutorial/transform-data.json`, `examples/quickstart/tutorial/updates-data.json`, `examples/quickstart/tutorial/updates-data2.json`, … (+8 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 9 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 21 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (21 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 2 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 5 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 11 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (7), REDACTED (4). — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
842 of 3000 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java. Counted over 3000 of the 6354 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 816 Orphaned file finding(s) in Knowledge Freshness — start with CoordinatorPollingBasicAuthorizerCacheManager.java, ExtensionsLoader.java, CacheScheduler.java. — One of this dimension's main actionable groups (816 recommendation-level).
Resolve the 26 Orphaned knowledge finding(s) in Knowledge Freshness — start with ConciseSet.java, OvershadowableManager.java, FixedBucketsHistogram.java. — One of this dimension's main actionable groups (26 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 3 Boundary-crossing change coupling finding(s) in Change Coupling — start with TaskAction.java (2), ExpressionModule.java. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 11 Change coupling finding(s) in Change Coupling — start with GroupByQueryKit.java, DruidCompactionConfig.java, CliIndexerServerModule.java. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with segments-view.tsx, datasources-view.tsx, ControllerImpl.java. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 173 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Do you agree with this assessment?
AC2 · Forms & labels3.3 / 10Weak✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — web-console/src/components/array-input/array-input.tsx:64, web-console/src/components/formatted-input/formatted-input.tsx:100, web-console/src/views/load-data-view/load-data-view.tsx:1309
This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×15) — web-console/src/components/auto-form/auto-form.tsx:333, web-console/src/components/auto-form/auto-form.tsx:388, web-console/src/components/console-table/console-table-pagination/page-jump-dialog/page-jump-dialog.tsx:46, …
This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×7) — web-console/src/components/console-table/table-filter-inputs.tsx:178, web-console/src/components/rule-editor/rule-editor.tsx:161, web-console/src/dialogs/diff-dialog/diff-dialog.tsx:102, …
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — web-console/src/components/show-log/show-log.tsx:196
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure4.3 / 10Weak✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — web-console/unified-console.html:20
user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. — web-console/unified-console.html:23
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. (×9) — web-console/src/components/click-to-copy/click-to-copy.tsx:32, web-console/src/components/query-error-pane/query-error-pane.tsx:50, web-console/src/components/query-error-pane/query-error-pane.tsx:92, …
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×7) — web-console/src/components/json-input/json-input.tsx:191, web-console/src/components/loader/loader.tsx:64, web-console/src/views/sql-data-loader-view/schema-step/column-list/expression-entry/expression-entry.tsx:45, …
This <div> announces itself as a role="separator" and is operated by mousedown and touchstart, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds). — web-console/src/components/splitter-layout/splitter-layout.tsx:234
This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. (×2) — web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:164, web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.tsx:230
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`#browser-update` sets color: #ffffff on background-color: #d9822b — 2.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — web-console/unified-console.html:34
`pre .copyCodeButton:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — website/static/css/code-block-buttons.css:35
`body.mouse-mode *:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web-console/src/entry.scss:52
`.recent-query-task-panel .work-entries .work-entry .line1 .status-icon.running svg` moves (`animation-name: spin`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.scss:87
`.current-dart-panel .work-entries .work-entry .line1 .status-icon.running svg` moves (`animation-name: spin`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.scss:84
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`TaskRunner` declares 16 abstract methods: `getBlacklistedTaskSlotCount`, `getIdleTaskSlotCount`, `getKnownTasks`, `getLazyTaskSlotCount`, `getPendingTasks`, `getRunningTasks`, `getScalingStats`, `getTotalTaskSlotCount`, `getUsedTaskSlotCount`, `registerListener`, `restore`, `run`, `shutdown`, `start`, `stop`, `unregisterListener`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunner.java:44
`TaskStorage` declares 16 abstract methods: `addLock`, `getActiveTaskInfos`, `getActiveTasks`, `getActiveTasksByDatasource`, `getCompletedTasksInfo`, `getLocks`, `getStatus`, `getTask`, `getTaskInfo`, `getTaskInfos`, `getTaskStatusPlusList`, `insert`, `removeLock`, `removeTasksOlderThan`, `replaceLock`, `setStatus`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskStorage.java:37
`FrameContext` declares 20 abstract methods: `acquireProcessingBuffers`, `close`, `coordinatorClient`, `dataServerQueryHandlerFactory`, `frameWriterSpec`, `indexIO`, `indexMerger`, `jsonMapper`, `memoryParameters`, `persistDir`, `policyEnforcer`, `processingBuffers`, `rowIngestionMeters`, `segmentManager`, `segmentPusher`, `segmentWrangler`, `storageParameters`, `tempDir`, `virtualStorageManager`, `wireTransferableContext`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — multi-stage-query/src/main/java/org/apache/druid/msq/exec/FrameContext.java:46
`WorkerContext` declares 17 abstract methods: `close`, `emitMetric`, `frameContext`, `includeAllCounters`, `injector`, `isDebug`, `jsonMapper`, `makeControllerClient`, `makeWorkerClient`, `maxConcurrentStages`, `policyEnforcer`, `queryId`, `registerWorker`, `selfNode`, `tempDir`, `threadCount`, `workerId`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerContext.java:44
`Query<T>` declares 18 abstract methods: `getContext`, `getDataSource`, `getDuration`, `getFilter`, `getGranularity`, `getId`, `getIntervals`, `getResultOrdering`, `getRunner`, `getSubQueryId`, `getTimezone`, `getType`, `hasFilters`, `withDataSource`, `withId`, `withOverriddenContext`, `withQuerySegmentSpec`, `withSubQueryId`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — processing/src/main/java/org/apache/druid/query/Query.java:76
`QueryMetrics<QueryType>` declares 55 abstract methods: `context`, `dataSource`, `duration`, `emit`, `hasFilters`, `identity`, `interval`, `makeBitmapResultFactory`, `parallelMergeParallelism`, `projection`, `query`, `queryId`, `queryId`, `queryType`, `remoteAddress`, `reportBackPressureTime`, `reportBitmapConstructionTime`, `reportCpuTime`, `reportNodeBytes`, `reportNodeTime`, `reportNodeTimeToFirstByte`, `reportParallelMergeFastestPartitionTime`, `reportParallelMergeInputRows`, `reportParallelMergeInputSequences`, `reportParallelMergeOutputRows`, `reportParallelMergeParallelism`, `reportParallelMergeSlowestPartitionTime`, `reportParallelMergeTaskCount`, `reportParallelMergeTotalCpuTime`, `reportParallelMergeTotalTime`, `reportPreFilteredRows`, `reportQueriedSegmentCount`, `reportQueryBytes`, `reportQueryTime`, `reportResultCachePoll`, `reportSegmentAndCacheTime`, `reportSegmentOnDemandLoadBytes`, `reportSegmentOnDemandLoadCount`, `reportSegmentOnDemandLoadTime`, `reportSegmentOnDemandLoadTimeAvg`, and 15 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 55 declarations carry 53 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 53 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — processing/src/main/java/org/apache/druid/query/QueryMetrics.java:162
`IncrementalIndexRowSelector` declares 17 abstract methods: `getColumnFormat`, `getDimension`, `getDimensionNames`, `getDimensions`, `getFacts`, `getLastRowIndex`, `getMetric`, `getMetricDoubleValue`, `getMetricFloatValue`, `getMetricLongValue`, `getMetricNames`, `getMetricObjectValue`, `getOrdering`, `getTimePosition`, `isEmpty`, `isNull`, `numRows`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndexRowSelector.java:32
`DimensionIndexer<EncodedType, EncodedKeyComponentType, ActualType>` declares 16 abstract methods: `checkUnsortedEncodedKeyComponentsEqual`, `compareUnsortedEncodedKeyComponents`, `convertUnsortedEncodedKeyComponentToActualList`, `convertUnsortedValuesToSorted`, `fillBitmapsFromUnsortedEncodedKeyComponent`, `getCardinality`, `getColumnCapabilities`, `getMaxValue`, `getMinValue`, `getSortedIndexedValues`, `getUnsortedEncodedKeyComponentHashCode`, `getUnsortedEncodedValueFromSorted`, `makeColumnValueSelector`, `makeDimensionSelector`, `processRowValsToUnsortedEncodedKeyComponent`, `setSparseIndexed`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — processing/src/main/java/org/apache/druid/segment/DimensionIndexer.java:112
`DataSourceCompactionConfig` declares 18 abstract methods: `getBaseTable`, `getDataSource`, `getDimensionsSpec`, `getEngine`, `getGranularitySpec`, `getInputSegmentSizeBytes`, `getIoConfig`, `getMaxRowsPerSegment`, `getMetricsSpec`, `getProjections`, `getSegmentGranularity`, `getSkipIntervals`, `getSkipOffsetFromLatest`, `getTaskContext`, `getTaskPriority`, `getTransformSpec`, `getTuningConfig`, `validate`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — server/src/main/java/org/apache/druid/server/coordinator/DataSourceCompactionConfig.java:53
`IndexerMetadataStorageCoordinator` declares 45 abstract methods: `allocatePendingSegment`, `allocatePendingSegments`, `commitAppendSegments`, `commitAppendSegmentsAndMetadata`, `commitMetadataOnly`, `commitReplaceSegments`, `commitSegments`, `commitSegmentsAndMetadata`, `deleteDataSourceMetadata`, `deletePendingSegments`, `deletePendingSegmentsCreatedInInterval`, `deletePendingSegmentsForTaskAllocatorId`, `deleteSegments`, `deleteUpgradeSegmentsForTask`, `getPendingSegments`, `getSegmentTimelineForAllocation`, `getUnusedSegmentIntervals`, `insertDataSourceMetadata`, `insertIntoUpgradeSegmentsTable`, `iterateAllUnusedSegmentsForDatasource`, `markAllNonOvershadowedSegmentsAsUsed`, `markAllSegmentsAsUnused`, `markNonOvershadowedSegmentsAsUsed`, `markNonOvershadowedSegmentsAsUsed`, `markSegmentAsUnused`, `markSegmentAsUsed`, `markSegmentsAsUnused`, `markSegmentsWithinIntervalAsUnused`, `removeDataSourceMetadataOlderThan`, `resetDataSourceMetadata`, `retrieveAllDatasourceNames`, `retrieveAllUsedSegments`, `retrieveDataSourceMetadata`, `retrieveSegmentForId`, `retrieveSegmentsById`, `retrieveSomeUnusedSegmentIntervals`, `retrieveSomeUnusedSegmentIntervals`, `retrieveUnusedSegmentsForInterval`, `retrieveUnusedSegmentsWithExactInterval`, `retrieveUpgradedFromSegmentIds`, and 5 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 45 declarations carry 43 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 43 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — server/src/main/java/org/apache/druid/indexing/overlord/IndexerMetadataStorageCoordinator.java:49
`CoordinatorClient` declares 18 abstract methods: `fetchAllUsedSegmentsWithOvershadowedStatus`, `fetchBootstrapSegments`, `fetchDataSourceInformation`, `fetchDataSourcesWithUsedSegments`, `fetchLookupsForTierSync`, `fetchSegment`, `fetchServerViewSegments`, `fetchUsedSegments`, `findCurrentLeader`, `getBrokerDynamicConfig`, `getCompactionSnapshots`, `getCoordinatorDynamicConfig`, `getRulesForAllDatasources`, `isHandoffComplete`, `updateAllLookups`, `updateCoordinatorDynamicConfig`, `updateRulesForDatasource`, `withRetryPolicy`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClient.java:45
`DatasourceSegmentMetadataReader` declares 16 abstract methods: `findExistingSegmentIds`, `findHighestUnusedSegmentId`, `findPendingSegmentIds`, `findPendingSegmentIdsWithExactInterval`, `findPendingSegments`, `findPendingSegmentsOverlapping`, `findPendingSegmentsWithExactInterval`, `findSegment`, `findSegments`, `findSegmentsWithSchema`, `findUnusedSegments`, `findUsedSegment`, `findUsedSegmentIdsOverlapping`, `findUsedSegments`, `findUsedSegmentsOverlappingAnyOf`, `findUsedSegmentsPlusOverlappingAnyOf`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — server/src/main/java/org/apache/druid/metadata/segment/DatasourceSegmentMetadataReader.java:37
`SegmentCacheManager` declares 16 abstract methods: `acquireCachedSegment`, `acquireSegment`, `bootstrap`, `canHandleSegments`, `canLoadSegmentOnDemand`, `canLoadSegmentsOnDemand`, `drop`, `getCachedSegments`, `getLoadingThreadPool`, `getLocations`, `getSegmentFiles`, `load`, `removeInfoFile`, `shutdown`, `shutdownBootstrap`, `storeInfoFile`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — server/src/main/java/org/apache/druid/segment/loading/SegmentCacheManager.java:38
`VirtualStorageLocationStats` declares 17 abstract methods: `getEvictionBytes`, `getEvictionCount`, `getHitBytes`, `getHitCount`, `getHoldBytes`, `getHoldCount`, `getInternalHoldBytes`, `getInternalHoldCount`, `getLoadBeginBytes`, `getLoadBeginCount`, `getLoadBytes`, `getLoadCount`, `getReadBytes`, `getReadCount`, `getReadTimeNanos`, `getRejectCount`, `getUsedBytes`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — server/src/main/java/org/apache/druid/segment/loading/VirtualStorageLocationStats.java:22
`OverlordClient` declares 26 abstract methods: `cancelTask`, `findCurrentLeader`, `findLockedIntervals`, `getClusterCompactionConfig`, `getTotalWorkerCapacity`, `getWorkers`, `isCompactionSupervisorEnabled`, `killPendingSegments`, `markNonOvershadowedSegmentsAsUsed`, `markNonOvershadowedSegmentsAsUsed`, `markSegmentAsUnused`, `markSegmentAsUsed`, `markSegmentsAsUnused`, `markSegmentsAsUnused`, `postSupervisor`, `resetToLatestAndBackfill`, `runTask`, `supervisorStatuses`, `taskPayload`, `taskReportAsMap`, `taskStatus`, `taskStatuses`, `taskStatuses`, `terminateSupervisor`, `updateClusterCompactionConfig`, `withRetryPolicy`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 26 declarations carry 23 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 23 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — server/src/main/java/org/apache/druid/rpc/indexing/OverlordClient.java:62
`BasicAuthorizerMetadataStorageUpdater` declares 18 abstract methods: `assignGroupMappingRole`, `assignUserRole`, `createGroupMapping`, `createRole`, `createUser`, `deleteGroupMapping`, `deleteRole`, `deleteUser`, `getCachedGroupMappingMap`, `getCachedRoleMap`, `getCachedUserMap`, `getCurrentGroupMappingMapBytes`, `getCurrentRoleMapBytes`, `getCurrentUserMapBytes`, `refreshAllNotification`, `setPermissions`, `unassignGroupMappingRole`, `unassignUserRole`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/BasicAuthorizerMetadataStorageUpdater.java:36
`BasicAuthorizerResourceHandler` declares 24 abstract methods: `assignRoleToGroupMapping`, `assignRoleToUser`, `authorizerGroupMappingUpdateListener`, `authorizerUserUpdateListener`, `createGroupMapping`, `createRole`, `createUser`, `deleteGroupMapping`, `deleteRole`, `deleteUser`, `getAllGroupMappings`, `getAllRoles`, `getAllUsers`, `getCachedGroupMappingMaps`, `getCachedUserMaps`, `getGroupMapping`, `getLoadStatus`, `getRole`, `getRolePermissions`, `getUser`, `refreshAll`, `setRolePermissions`, `unassignRoleFromGroupMapping`, `unassignRoleFromUser`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/BasicAuthorizerResourceHandler.java:33
`KubernetesTaskRunnerConfig` declares 25 abstract methods: `getAdvertisedPlaintextPort`, `getAnnotations`, `getCapacity`, `getCpuCoreInMicro`, `getGraceTerminationPeriodSeconds`, `getJavaOptsArray`, `getK8sSharedInformerResyncPeriod`, `getK8sTaskPodNamePrefix`, `getKubexitImage`, `getLabels`, `getLogSaveTimeout`, `getNamespace`, `getOverlordNamespace`, `getPeonMonitors`, `getPrimaryContainerName`, `getTaskCleanupDelay`, `getTaskCleanupInterval`, `getTaskJoinTimeout`, `getTaskLaunchTimeout`, `getTaskTimeout`, `isAllowTaskPodTemplateSelection`, `isDebugJobs`, `isDisableClientProxy`, `isSidecarSupport`, `isUseK8sSharedInformers`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunnerConfig.java:30
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
AX8 · Test isolation0.0 / 10Critical✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
`druid-compressed-bigdecimal` (production) references the test project `druid-processing (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`druid-quidem-ut` (production) references the test project `druid-datasketches (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`druid-quidem-ut` (production) references the test project `druid-multi-stage-query (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`druid-quidem-ut` (production) references the test project `druid-processing (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`druid-quidem-ut` (production) references the test project `druid-server (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`druid-quidem-ut` (production) references the test project `druid-sql (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`druid-redis-cache` (production) references the test project `druid-server (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
What to do
Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Java: methods that only throw a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. (×19) — extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:101, extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildAggregator.java:54, extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildBufferAggregator.java:81, …
`getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. (×18) — extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:107, extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildAggregator.java:60, extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildBufferAggregator.java:69, …
`getDouble` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. (×3) — extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildBufferAggregator.java:75, extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeBufferAggregator.java:71, extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMergeBufferAggregator.java:95
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Clear the softer debt: re-enable or delete @Disabled/@Ignore tests, decide whether each empty method or UnsupportedOperationException is deliberate (and say so in a comment), and replace @SuppressWarnings("all") with targeted, justified suppressions.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/input/ShuffleSpec.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/input/ShuffleSpec.java` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — multi-stage-query/README.md:45
multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/kernel/exec/ControllerImpl.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/kernel/exec/ControllerImpl.java` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — multi-stage-query/README.md:97
multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/kernel/exec/WorkerImpl.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/kernel/exec/WorkerImpl.java` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — multi-stage-query/README.md:99
What to do
Reconcile the README with reality: multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/input/ShuffleSpec.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/input/ShuffleSpec.java` does not exist; multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/kernel/exec/ControllerImpl.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/kernel/exec/ControllerImpl.java` does not exist; multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/kernel/exec/WorkerImpl.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/kernel/exec/WorkerImpl.java` does not exist.
Only 56/57 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `extensions-core/parquet-extensions`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
`REDACTED` schedules updates, but no `package-ecosystem` entry covers `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — REDACTED:2
What to do
Dependabot is configured but does not watch `pip` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Do you agree with this assessment?
P6 · Release Hygiene8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
What to do
Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`HttpClients.custom(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:245
`.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — extensions-core/druid-pac4j/src/main/java/org/apache/druid/security/pac4j/CustomSSLResourceRetriever.java:52, extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/FileBasedProtobufBytesDecoder.java:77, processing/src/main/java/org/apache/druid/data/input/impl/HttpEntity.java:91
`HttpClient.newBuilder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/httpclient/jdk/DruidKubernetesJdkHttpClientFactory.java:54
`HttpClient` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — processing/src/main/java/org/apache/druid/java/util/http/client/AbstractHttpClient.java:25, processing/src/main/java/org/apache/druid/java/util/http/client/HttpClient.java:29
`HttpClients.createDefault(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:66
What to do
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety9.9 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
47 duplicated blocks under web-console/src/ have copies in at least two of the sibling directories components, dialogs, druid-models, helpers, utils, views — 27 of them are reported below, and 20 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 47 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 47 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 47 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web-console/src/components/record-table-pane/record-table-pane.tsx:149
46 duplicated blocks under web-console/src/views/ have copies in at least two of the sibling directories datasources-view, explore-view, load-data-view, lookups-view, segments-view, services-view (+4 more sibling(s) not listed) — 26 of them are reported below, and 20 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 46 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 46 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 46 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:101
17 duplicated blocks under web-console/src/dialogs/ have copies in at least two of the sibling directories about-dialog, async-action-dialog, broker-dynamic-config-dialog, compaction-dynamic-config-dialog, coordinator-dynamic-config-dialog, datasource-table-action-dialog (+14 more sibling(s) not listed) — 9 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 17 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web-console/src/dialogs/coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog.tsx:41
7 duplicated blocks under web-console/src/views/explore-view/modules/ have copies in at least two of the sibling directories bar-chart-module, grouping-table-module, multi-axis-chart-module, pie-chart-module, record-table-module, time-chart-module — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:103
6 duplicated blocks under web-console/src/views/workbench-view/ have copies in at least two of the sibling directories current-dart-panel, execution-details-dialog, execution-details-pane-loader, execution-stages-pane-loader, execution-submit-dialog, explain-dialog (+4 more sibling(s) not listed) — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:39
5 duplicated blocks under web-console/src/views/workbench-view/column-tree/column-tree-menu/ have copies in at least two of the sibling directories complex-menu-items, number-menu-items, string-menu-items, time-menu-items — 4 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web-console/src/views/workbench-view/column-tree/column-tree-menu/number-menu-items/number-menu-items.tsx:30
web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:39 · web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.tsx:55 — the two spans are one implementation copied and then locally edited — 692 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:39
web-console/src/views/explore-view/components/resource-pane/column-dialog/column-dialog.tsx:35 · web-console/src/views/explore-view/components/resource-pane/measure-dialog/measure-dialog.tsx:33 — the two spans are one implementation copied and then locally edited — 691 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/explore-view/components/resource-pane/column-dialog/column-dialog.tsx:35
web-console/src/dialogs/coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog.tsx:41 · web-console/src/dialogs/overlord-dynamic-config-dialog/overlord-dynamic-config-dialog.tsx:41 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web-console/src/dialogs/coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog.tsx:41
web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:101 · web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:428 — the two spans are one implementation copied and then locally edited — 452 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:101
web-console/src/dialogs/broker-dynamic-config-dialog/broker-dynamic-config-dialog.tsx:37 · web-console/src/dialogs/overlord-dynamic-config-dialog/overlord-dynamic-config-dialog.tsx:37 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web-console/src/dialogs/broker-dynamic-config-dialog/broker-dynamic-config-dialog.tsx:37
web-console/src/views/workbench-view/column-tree/column-tree-menu/number-menu-items/number-menu-items.tsx:30 · web-console/src/views/workbench-view/column-tree/column-tree-menu/time-menu-items/time-menu-items.tsx:56 — the two spans are one implementation copied and then locally edited — 498 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/workbench-view/column-tree/column-tree-menu/number-menu-items/number-menu-items.tsx:30
web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:103 · web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:77 — the two spans are one implementation copied and then locally edited — 424 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:103
web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:186 · web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:188 — the two spans are one implementation copied and then locally edited — 324 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:186
web-console/src/views/load-data-view/filter-table/filter-table.tsx:38 · web-console/src/views/load-data-view/transform-table/transform-table.tsx:39 — the two spans are one implementation copied and then locally edited — 408 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/load-data-view/filter-table/filter-table.tsx:38
web-console/src/components/show-json-or-stages/show-json-or-stages.tsx:34 · web-console/src/components/show-json/show-json.tsx:32 — the two spans are one implementation copied and then locally edited — 329 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/components/show-json-or-stages/show-json-or-stages.tsx:34
web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:58 · web-console/src/views/workbench-view/column-tree/column-tree-menu/time-menu-items/time-menu-items.tsx:108 — the two spans are one implementation copied and then locally edited — 323 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:58
web-console/src/views/load-data-view/load-data-view.tsx:1811 · web-console/src/views/load-data-view/load-data-view.tsx:2000 — the two spans are one implementation copied and then locally edited — 298 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/load-data-view/load-data-view.tsx:1811
web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:196 · web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:199 — the two spans are one implementation copied and then locally edited — 255 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:196
web-console/src/dialogs/supervisor-table-action-dialog/supervisor-table-action-dialog.tsx:38 · web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.tsx:34 — the two spans are one implementation copied and then locally edited — 231 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web-console/src/dialogs/supervisor-table-action-dialog/supervisor-table-action-dialog.tsx:38
web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:390 · web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:643 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:390
web-console/src/views/explore-view/components/filter-pane/filter-menu/contains-filter-control/contains-filter-control.tsx:31 · REDACTED:40 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web-console/src/views/explore-view/components/filter-pane/filter-menu/contains-filter-control/contains-filter-control.tsx:31
web-console/src/druid-models/input-source/input-source.tsx:320 · web-console/src/druid-models/input-source/input-source.tsx:382 · web-console/src/druid-models/input-source/input-source.tsx:456 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web-console/src/druid-models/input-source/input-source.tsx:320
web-console/src/views/explore-view/utils/table-query.ts:565 · web-console/src/views/explore-view/utils/table-query.ts:825 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/views/explore-view/utils/table-query.ts:565
web-console/src/components/record-table-pane/record-table-pane.tsx:149 · web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:709 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/components/record-table-pane/record-table-pane.tsx:149
web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:280 · web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:333 · web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:304 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:280
web-console/src/views/datasources-view/datasources-view.tsx:1396 · web-console/src/views/datasources-view/datasources-view.tsx:1428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web-console/src/views/datasources-view/datasources-view.tsx:1396
web-console/src/druid-models/compaction-config/compaction-config.tsx:112 · web-console/src/druid-models/compaction-config/compaction-config.tsx:141 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/druid-models/compaction-config/compaction-config.tsx:112
web-console/src/views/segments-view/segments-view.tsx:394 · web-console/src/views/supervisors-view/supervisors-view.tsx:337 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/views/segments-view/segments-view.tsx:394
web-console/src/components/auto-form/auto-form.tsx:263 · web-console/src/components/auto-form/auto-form.tsx:294 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/components/auto-form/auto-form.tsx:263
web-console/src/components/record-table-pane/record-table-pane.tsx:75 · web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:599 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/components/record-table-pane/record-table-pane.tsx:75
web-console/src/utils/sampler.ts:496 · web-console/src/utils/sampler.ts:565 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/utils/sampler.ts:496
web-console/src/views/load-data-view/load-data-view.tsx:2247 · web-console/src/views/load-data-view/load-data-view.tsx:2416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web-console/src/views/load-data-view/load-data-view.tsx:2247
web-console/src/views/supervisors-view/supervisors-view.tsx:1390 · web-console/src/views/tasks-view/tasks-view.tsx:687 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web-console/src/views/supervisors-view/supervisors-view.tsx:1390
web-console/src/dialogs/datasource-table-action-dialog/datasource-preview-pane/datasource-preview-pane.tsx:46 · web-console/src/dialogs/segments-table-action-dialog/segments-preview-pane/segments-preview-pane.tsx:100 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/dialogs/datasource-table-action-dialog/datasource-preview-pane/datasource-preview-pane.tsx:46
web-console/src/views/datasources-view/datasources-view.tsx:513 · web-console/src/views/datasources-view/datasources-view.tsx:545 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/views/datasources-view/datasources-view.tsx:513
web-console/src/views/explore-view/components/resource-pane/resource-pane.tsx:202 · web-console/src/views/explore-view/components/resource-pane/resource-pane.tsx:285 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/views/explore-view/components/resource-pane/resource-pane.tsx:202
web-console/src/views/supervisors-view/supervisors-view.tsx:1265 · web-console/src/views/supervisors-view/supervisors-view.tsx:1291 · web-console/src/views/supervisors-view/supervisors-view.tsx:1317 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/views/supervisors-view/supervisors-view.tsx:1265
web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:157 · web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:180 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:157
web-console/src/views/workbench-view/column-tree/column-tree.tsx:375 · web-console/src/views/workbench-view/column-tree/column-tree.tsx:403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web-console/src/views/workbench-view/column-tree/column-tree.tsx:375
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts:39 imports web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts:39
web-console/src/views/workbench-view/run-panel/run-panel.tsx:42 imports web-console/src/dialogs/index-spec-dialog/index-spec-dialog.tsx, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — web-console/src/views/workbench-view/run-panel/run-panel.tsx:42
What to do
Fix the listed violations: move the shared test helper into a source directory production code may depend on (2 rows).
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
SchemaStep has cyclomatic complexity 67 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:265
convertSpecToSql has cyclomatic complexity 50 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/helpers/spec-conversion.ts:82
RunPanel has cyclomatic complexity 41 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/workbench-view/run-panel/run-panel.tsx:184
getHeaderMenu has cyclomatic complexity 35 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:167
getApiQuery has cyclomatic complexity 35 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/druid-models/workbench-query/workbench-query.ts:503
SegmentBarChartRender has cyclomatic complexity 30 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:201
run has cyclomatic complexity 27 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/utils/query-manager/query-manager.ts:125
renderContent has cyclomatic complexity 27 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/workbench-view/execution-details-pane/execution-details-pane.tsx:59
getSqlCompletions has cyclomatic complexity 26 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/editor-completions/sql-completions.ts:236
ContinuousChartRender has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx:150
getByPartitionCountersForStage has cyclomatic complexity 24 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/druid-models/stages/stages.ts:745
fitIngestQueryPattern has cyclomatic complexity 24 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts:140
ConsoleTable has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/components/console-table/console-table.tsx:347
SegmentTimeline has cyclomatic complexity 24 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/components/segment-timeline/segment-timeline.tsx:81
DetailCell has cyclomatic complexity 23 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/services-view/services-view.tsx:254
ColumnEditor has cyclomatic complexity 23 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx:129
issueWithInputSource has cyclomatic complexity 23 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/druid-models/input-source/input-source.tsx:142
FilterMenu has cyclomatic complexity 23 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:120
ExpressionEditor has cyclomatic complexity 22 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:39
summarizeInputSource has cyclomatic complexity 22 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/druid-models/external-config/external-config.ts:55
ExploreView has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/explore-view/explore-view.tsx:114
InputFormatStep has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/workbench-view/input-format-step/input-format-step.tsx:92
MeasureMenu has cyclomatic complexity 21 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/explore-view/components/control-pane/measure-menu.tsx:56
guessDataSourceNameFromInputSource has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:1631
getTaskExecution has cyclomatic complexity 19 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/helpers/execution/sql-task-execution.ts:161
(anonymous) has cyclomatic complexity 19 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/editor-languages/hjson-tokens.ts:142
renderOptionsPropInput has cyclomatic complexity 19 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/explore-view/components/control-pane/control-pane.tsx:81
(anonymous) has cyclomatic complexity 18 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/explore-view/utils/time-manipulation.ts:117
getRangeInExpression has cyclomatic complexity 18 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/explore-view/modules/time-chart-module/time-chart-module.tsx:60
CellFilterMenu has cyclomatic complexity 18 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/components/cell-filter-menu/cell-filter-menu.tsx:88
issueWithIoConfig has cyclomatic complexity 18 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:1350
parseIsoDate has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/utils/date.ts:134
QueryTab has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/workbench-view/query-tab/query-tab.tsx:108
processQuery has cyclomatic complexity 17 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/segments-view/segments-view.tsx:309
(anonymous) has cyclomatic complexity 17 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/load-data-view/schema-table/schema-table.tsx:82
HeaderBar has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/components/header-bar/header-bar.tsx:72
QueryErrorPane has cyclomatic complexity 17 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/components/query-error-pane/query-error-pane.tsx:34
ContinuousChartSingleRender has cyclomatic complexity 17 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-single-render.tsx:70
(anonymous) has cyclomatic complexity 16 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:388
handleSubmit has cyclomatic complexity 16 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web-console/src/views/workbench-view/execution-submit-dialog/execution-submit-dialog.tsx:59
Do you agree with this assessment?
R3 · Large Files6.3 / 10Adequate✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
web-console/src/views/load-data-view/load-data-view.tsx has 3519 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/load-data-view/load-data-view.tsx:1
web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx has 2664 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:1
web-console/src/views/datasources-view/datasources-view.tsx has 1750 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/datasources-view/datasources-view.tsx:1
web-console/src/views/supervisors-view/supervisors-view.tsx has 1331 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/supervisors-view/supervisors-view.tsx:1
web-console/src/views/services-view/services-view.tsx has 1246 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/services-view/services-view.tsx:1
web-console/src/views/segments-view/segments-view.tsx has 1152 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/segments-view/segments-view.tsx:1
web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx has 1046 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx:1
web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx has 1027 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:1
web-console/src/druid-models/native-json-query/native-json-query-completions.ts has 1023 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/native-json-query/native-json-query-completions.ts:1
web-console/src/views/workbench-view/workbench-view.tsx has 968 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/workbench-view/workbench-view.tsx:1
web-console/src/views/load-data-view/ingestion-spec-completions.ts has 908 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/load-data-view/ingestion-spec-completions.ts:1
web-console/src/views/explore-view/utils/table-query.ts has 841 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/explore-view/utils/table-query.ts:1
web-console/src/components/console-table/console-table.tsx has 778 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/components/console-table/console-table.tsx:1
web-console/src/druid-models/stages/stages.ts has 740 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/stages/stages.ts:1
web-console/src/components/segment-timeline/segment-bar-chart-render.tsx has 714 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:1
web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx has 714 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:1
web-console/src/views/tasks-view/tasks-view.tsx has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/tasks-view/tasks-view.tsx:1
web-console/src/views/workbench-view/run-panel/run-panel.tsx has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/workbench-view/run-panel/run-panel.tsx:1
web-console/src/views/workbench-view/column-tree/column-tree.tsx has 682 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/workbench-view/column-tree/column-tree.tsx:1
web-console/src/utils/general.tsx has 663 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/utils/general.tsx:1
web-console/src/druid-models/input-source/input-source.tsx has 657 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/input-source/input-source.tsx:1
web-console/src/druid-models/input-format/input-format.tsx has 646 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/input-format/input-format.tsx:1
web-console/src/utils/sampler.ts has 639 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/utils/sampler.ts:1
web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx has 589 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx:1
web-console/src/views/workbench-view/query-tab/query-tab.tsx has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/workbench-view/query-tab/query-tab.tsx:1
web-console/src/druid-models/lookup-spec/lookup-spec.tsx has 576 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/lookup-spec/lookup-spec.tsx:1
web-console/src/druid-models/execution/execution.ts has 565 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/execution/execution.ts:1
web-console/src/druid-models/workbench-query/workbench-query.ts has 561 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/workbench-query/workbench-query.ts:1
web-console/src/components/auto-form/auto-form.tsx has 535 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/components/auto-form/auto-form.tsx:1
web-console/src/views/lookups-view/lookups-view.tsx has 506 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/lookups-view/lookups-view.tsx:1
web-console/src/views/explore-view/explore-view.tsx has 497 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/explore-view/explore-view.tsx:1
web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx has 464 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:1
web-console/src/console-application.tsx has 454 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/console-application.tsx:1
web-console/src/components/header-bar/header-bar.tsx has 451 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/components/header-bar/header-bar.tsx:1
web-console/src/druid-models/metric-spec/metric-spec.tsx has 451 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/druid-models/metric-spec/metric-spec.tsx:1
web-console/src/helpers/spec-conversion.ts has 447 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/helpers/spec-conversion.ts:1
web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx has 432 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:1
web-console/src/editor-completions/sql-completions.ts has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web-console/src/editor-completions/sql-completions.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage7.6 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:1, web-console/src/views/workbench-view/workbench-view.tsx:1, web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
44 outdated package(s); JS/npm CVEs scored in D30
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code9.6 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 73 application, 10 tooling and 214 test entry point(s) detected in this repo. Gate removals on `npm run compile` — an undetected custom entry would make these reachable.
no import path from any entry point (73 application, 10 tooling, 214 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×3) — web-console/src/editor-languages/hjson-tokens.ts, web-console/src/views/workbench-view/execution-stages-pane-loader/execution-stages-pane-loader.tsx, web-console/src/druid-models/dart/dart-query-entry.mock.ts
Nothing ultimately consumes this binding: its only referrer is the re-export in web-console/src/druid-models/broker-dynamic-config/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web-console/src/druid-models/broker-dynamic-config/index.ts in the same commit, or the barrel will import a name that no longer exists. — web-console/src/druid-models/broker-dynamic-config/broker-dynamic-config.mock.ts:21
Nothing ultimately consumes this binding: its only referrer is the re-export in web-console/src/druid-models/mocks.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web-console/src/druid-models/mocks.ts in the same commit, or the barrel will import a name that no longer exists. — web-console/src/druid-models/coordinator-dynamic-config/coordinator-dynamic-config.mock.ts:21
Nothing ultimately consumes this binding: its only referrer is the re-export in web-console/src/druid-models/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web-console/src/druid-models/index.ts in the same commit, or the barrel will import a name that no longer exists. (×3) — web-console/src/druid-models/external-config/external-config.ts:114, web-console/src/druid-models/input-source/input-source.tsx:83, web-console/src/druid-models/task/task.ts:33
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in web-console/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Every import is type-only — move it to devDependencies. — web-console/src/components/code-editor/completion-source.ts:28
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
web-console/src/helpers/index.ts → web-console/src/helpers/capabilities.ts → web-console/src/helpers/index.ts (one verified cycle inside a mutually-dependent group of 67 files) — web-console/src/helpers/index.ts:19
web-console/src/singletons/api.ts → web-console/src/utils/index.tsx → web-console/src/utils/download-query-detail-archive.ts → web-console/src/singletons/index.ts → web-console/src/singletons/api.ts (one verified cycle inside a mutually-dependent group of 14 files) — web-console/src/singletons/api.ts:23
web-console/src/views/explore-view/models/explore-state.ts → web-console/src/views/explore-view/models/expression-meta.ts → web-console/src/views/explore-view/utils/index.ts → web-console/src/views/explore-view/utils/table-query.ts → web-console/src/views/explore-view/models/index.ts → web-console/src/views/explore-view/models/explore-state.ts (one verified cycle inside a mutually-dependent group of 10 files) — web-console/src/views/explore-view/models/explore-state.ts:41
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader1.2 / 10Critical✓ Tool-verified
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
`decompressedLen` is read from the bytes being parsed at line 185 (`getInt`), then used to size a `new byte[]` at line 186 — and nowhere in its scope is `decompressedLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `decompressedLen` against the bytes actually remaining and a maximum the format allows before allocating. — server/src/main/java/org/apache/druid/client/cache/CaffeineCache.java:186
`size` is read from the bytes being parsed at line 71 (`getInt`), then used to size a `new byte[]` at line 73 — and nowhere in its scope is `size` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating. — server/src/main/java/org/apache/druid/client/cache/LZ4Transcoder.java:73
`keyLength` is read from the bytes being parsed at line 550 (`getInt`), then used to size a `new byte[]` at line 551 — and nowhere in its scope is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining and a maximum the format allows before allocating. — server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:551
`fileNameLength` is read from the bytes being parsed at line 373 (`readInt`), then used to size a `new byte[]` at line 374 — and nowhere in its scope is `fileNameLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `fileNameLength` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/utils/CompressionUtils.java:374
`metaLength` is read from the bytes being parsed at line 119 (`getInt`), then used to size a `new byte[]` at line 120 — and nowhere in its scope is `metaLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `metaLength` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/segment/file/SegmentFileMetadataReader.java:120
`compressedLength` is read from the bytes being parsed at line 136 (`getInt`), then used to size a `new byte[]` at line 139 — and nowhere in its scope is `compressedLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `compressedLength` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/segment/file/SegmentFileMetadataReader.java:139
`length` is read from the bytes being parsed at line 491 (`getInt`), then used to size a `new byte[]` at line 492 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:492
`arrayLength` is read from the bytes being parsed at line 587 (`getInt`), then used to size a `new Object[]` at line 588 — and nowhere in its scope is `arrayLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `arrayLength` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:588
`n` is read from the bytes being parsed at line 198 (`getInt`), then used to size a `new float[]` at line 199 — and nowhere in its scope is `n` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `n` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/query/aggregation/Histogram.java:199
`stringSize` is read from the bytes being parsed at line 238 (`getInt`), then used to size a `new byte[]` at line 242 — and nowhere in its scope is `stringSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSize` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:242
`stringSize` is read from the bytes being parsed at line 121 (`getInt`), then used to size a `new byte[]` at line 125 — and nowhere in its scope is `stringSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSize` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:125
`stringSize` is read from the bytes being parsed at line 102 (`getInt`), then used to size a `new byte[]` at line 106 — and nowhere in its scope is `stringSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSize` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:106
`stringSizeBytes` is read from the bytes being parsed at line 125 (`getInt`), then used to size a `new byte[]` at line 129 — and nowhere in its scope is `stringSizeBytes` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSizeBytes` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/query/aggregation/firstlast/StringFirstLastUtils.java:129
`stringSizeBytes` is read from the bytes being parsed at line 96 (`getInt`), then used to size a `new byte[]` at line 98 — and nowhere in its scope is `stringSizeBytes` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSizeBytes` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:98
`stringSizeBytes` is read from the bytes being parsed at line 141 (`getInt`), then used to size a `new byte[]` at line 143 — and nowhere in its scope is `stringSizeBytes` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSizeBytes` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyVectorAggregator.java:143
`signatureLen` is read from the bytes being parsed at line 121 (`getInt`), then used to size a `new byte[]` at line 122 — and nowhere in its scope is `signatureLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `signatureLen` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/frame/wire/FrameWireTransferable.java:122
`saltSize` is read from the bytes being parsed at line 208 (`getInt`), then used to size a `new byte[]` at line 212 — and nowhere in its scope is `saltSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `saltSize` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/crypto/CryptoService.java:212
`ivSize` is read from the bytes being parsed at line 209 (`getInt`), then used to size a `new byte[]` at line 215 — and nowhere in its scope is `ivSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `ivSize` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/crypto/CryptoService.java:215
`cipherSize` is read from the bytes being parsed at line 210 (`getInt`), then used to size a `new byte[]` at line 218 — and nowhere in its scope is `cipherSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `cipherSize` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/crypto/CryptoService.java:218
`length` is read from the bytes being parsed at line 86 (`getInt`), then used to size a `new String[]` at line 88 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating. — processing/src/main/java/org/apache/druid/common/utils/SerializerUtils.java:88
`keyLength` is read from the bytes being parsed at line 161 (`getInt`), then used to size a `new byte[]` at line 169 — and nowhere in its scope is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining and a maximum the format allows before allocating. — multi-stage-query/src/main/java/org/apache/druid/msq/statistics/serde/ClusterByStatisticsSnapshotSerde.java:169
`length` is read from the bytes being parsed at line 71 (`getInt`), then used to size a `new byte[]` at line 77 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating. — multi-stage-query/src/main/java/org/apache/druid/msq/statistics/serde/KeyCollectorSnapshotDeserializer.java:77
`keyLength` is read from the bytes being parsed at line 108 (`getInt`), then used to size a `new byte[]` at line 114 — and nowhere in its scope is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining and a maximum the format allows before allocating. — multi-stage-query/src/main/java/org/apache/druid/msq/statistics/serde/KeyCollectorSnapshotDeserializer.java:114
`sketchLength` is read from the bytes being parsed at line 134 (`getInt`), then used to size a `new byte[]` at line 135 — and nowhere in its scope is `sketchLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `sketchLength` against the bytes actually remaining and a maximum the format allows before allocating. — multi-stage-query/src/main/java/org/apache/druid/msq/statistics/serde/KeyCollectorSnapshotDeserializer.java:135
`size` is read from the bytes being parsed at line 1309 (`getInt`), then used to size a `new float[]` at line 1312 — and nowhere in its scope is `size` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating. — extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1312
`size` is read from the bytes being parsed at line 1335 (`getInt`), then used to size a `new float[]` at line 1338 — and nowhere in its scope is `size` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating. — extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1338
`numBuckets` is read from the bytes being parsed at line 995 (`getInt`), then used to size a `new long[]` at line 1006 — and nowhere in its scope is `numBuckets` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numBuckets` against the bytes actually remaining and a maximum the format allows before allocating. — extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:1006
`numBuckets` is read from the bytes being parsed at line 1036 (`getInt`), then used to size a `new long[]` at line 1048 — and nowhere in its scope is `numBuckets` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numBuckets` against the bytes actually remaining and a maximum the format allows before allocating. — extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:1048
`bitsetArrayLen` is read from the bytes being parsed at line 169 (`readInt`), then used to size a `new long[]` at line 170 — and nowhere in its scope is `bitsetArrayLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `bitsetArrayLen` against the bytes actually remaining and a maximum the format allows before allocating. — extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:170
`bitsetArrayLen` is read from the bytes being parsed at line 277 (`getInt`), then used to size a `new long[]` at line 278 — and nowhere in its scope is `bitsetArrayLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `bitsetArrayLen` against the bytes actually remaining and a maximum the format allows before allocating. — extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:278
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`headerOut` is a `new HeapByteBufferWriteOutBytes(…)`, which holds something that has to be given back, and it is created here (line 761). Every use of it in this block calls a member through it — it is never returned, never stored, never handed to anything else, no view of it is handed on, it is not captured by a lambda or an anonymous class, and it is never released — so this block both creates the value and is the last thing that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it. Declare it in a try-with-resources (`try (HeapByteBufferWriteOutBytes headerOut = …)`), which releases it on every path including a throw, or call `headerOut.close()` in a `finally`. — processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:761
`headerBytes` is a `new HeapByteBufferWriteOutBytes(…)`, which holds something that has to be given back, and it is created here (line 68). Every use of it in this block calls a member through it — it is never returned, never stored, never handed to anything else, no view of it is handed on, it is not captured by a lambda or an anonymous class, and it is never released — so this block both creates the value and is the last thing that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it. Declare it in a try-with-resources (`try (HeapByteBufferWriteOutBytes headerBytes = …)`), which releases it on every path including a throw, or call `headerBytes.close()` in a `finally`. — processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarMultiInts.java:68
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 21/22 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`processQuery` holds an AbortSignal but calls `runSqlQuery(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `runSqlQuery(…, { signal })`. — web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:138
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
`debug` at line 697 is called with an argument built by `join(currentHydrants.entrySet().stream().map(entry -> StringUtils.format("…", entry.getKey(), entry.getValue())).coll...` (line 700), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:697
`debug` at line 816 is called with an argument built by `stream()` (line 818), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:816
`debug` at line 217 is called with an argument built by `String.join("…", before)` (line 217), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:217
`debug` at line 375 is called with an argument built by `String.join("…", ids)` (line 375), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:375
`debug` at line 430 is called with an argument built by `String.join("…", instanceIds)` (line 430), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:430
What to do
In Java, put the construction behind the logger's own check (`if (log.isDebugEnabled())` for SLF4J and Log4j, `if (logger.isLoggable(Level.FINE))` for java.util.logging), or hand the logger a lambda it calls only when the level is on (Log4j 2's `Supplier` overloads, SLF4J 2's `log.atDebug().addArgument(() -> …)`). A `{}` placeholder alone is not the fix: it defers the formatting, not the stream, join or serialisation in the argument.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated8.0 / 10Strong✓ Tool-verified
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
`this.columns` is enumerated directly, and line 70 calls `this.columns.add(…)` inside the loop body — a structural change to a `TreeSet`. The loop's hidden iterator is fail-fast, so its next `next()` throws `ConcurrentModificationException`: every pass that reaches this call ends the loop by exception instead of by running out of elements, and the remaining elements are never seen. — processing/src/main/java/org/apache/druid/query/metadata/metadata/ListColumnIncluderator.java:68
What to do
Each finding names the two spans that cannot both stand — the enhanced `for` source, and the call inside the body that structurally changes that same collection. Confirm from those two, then pick one: remove through the iterator itself (`Iterator<T> it = c.iterator(); … it.remove();`) or replace the loop with `c.removeIf(…)`; iterate a copy (`for (T x : new ArrayList<>(c))`); collect what needs changing and apply it after the loop; or — where the loop was only ever meant to act on the first match — `break` immediately after the mutation, which is the one shape that is already safe. In Python: Each finding names the two lines that cannot both stand — the `for` over the collection (or its `keys()`/`values()`/`items()` view), and the call inside the body that changes its size. Confirm from those two, then pick one: walk a snapshot (`for k in list(d):`, `for x in s.copy():`); build the result instead of editing in place (`d = {k: v for k, v in d.items() if keep(v)}`); collect what needs removing and remove it after the loop; or — where only the first match was ever meant — `break` straight after the change, which is the one shape that is already safe.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×10) — web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:323, web-console/src/views/load-data-view/load-data-view.tsx:3604, web-console/src/utils/sql.ts:108, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×3) — web-console/src/views/workbench-view/query-tab/query-tab.tsx:241, web-console/src/views/workbench-view/query-tab/query-tab.tsx:288, web-console/src/helpers/execution/sql-task-execution.ts:255
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×21) — web-console/src/views/load-data-view/load-data-view.tsx:3616, web-console/src/utils/download-query-detail-archive.ts:49, web-console/src/utils/download-query-detail-archive.ts:53, …
`catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×2) — web-console/src/helpers/capabilities.ts:105, web-console/src/dialogs/doctor-dialog/doctor-checks.tsx:376
`catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — processing/src/main/java/org/apache/druid/query/QueryException.java:213, jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnection.java:409, indexing-service/src/main/java/org/apache/druid/indexing/common/actions/LocalTaskActionClient.java:128
An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `close()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. — multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/FutureReadableFrameChannel.java:107
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~0.7 `!` null assertions per 1k TypeScript source lines — 52 assertion(s) across the 79306 source line(s) of the 405 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: web-console/src/views/explore-view/utils/table-query.ts (9), web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx (7), web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-single-render.tsx (5). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 5 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
D36 Supply-chain Provenance & Signing — 5 observation(s) recorded · The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 14 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 40 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — -------------------- ERROR: failed to solve: process "/bin/sh -c yum clean all && rpm --rebuilddb && yum install -y curl which tar sudo openssh-server openssh-clients rsync yum-plugin-ovl && yum clean all && yum update -y libselinux && yum update -y nss && yum clean all" did not complete successfully: exit code: 1; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
D12 Dependency Hygiene — Not scored — a Maven build resolved 131 artifact(s) (47 behind a shipped release, reported), but the build resolved only part of the graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; Java, JavaScript, Python, html not measured.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D25 ADR Conformance — no ADRs to check
D32 Data Compliance (PII/GDPR) — 5 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
DM1 Domain Modelling — applicable but not scored (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 2 aggregate root(s) (AggregateRoot/IAggregateRoot); 1089 value object(s); 11 domain event(s); its domain events are published by services or handlers — no domain entity raises one; a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (23 CQRS handler(s))
ED5 Idempotency — Not assessed, and this one is on us: 23 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
P8 Schema migrations — jOOQ is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
P9 Domain vs controller coverage — coverage data present for 139 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — X1 reached only 8% of this repository's production lines — java (859,488 lines), r (602 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X12 Unreachable branch — X12 reached only 8% of this repository's production lines — java (859,488 lines), r (602 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — X17 reached only 8% of this repository's production lines — java (859,488 lines), r (602 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Orphaned knowledge processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge processing/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge processing/src/main/java/org/apache/druid/query/context/ResponseContext.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/BasicAuthorizerResource.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge sql/src/main/java/org/apache/druid/sql/calcite/rel/Windowing.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TaskMonitor.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-contrib/openlineage-emitter/src/main/java/org/apache/druid/extensions/openlineage/OpenLineageRequestLogger.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge processing/src/main/java/org/apache/druid/error/DruidException.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ParallelCombiner.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouper.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge processing/src/main/java/org/apache/druid/query/operator/join/SortedInnerJoinOperator.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulLeaderSelector.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
AX8 · Test isolation· Production project references a test project · ×7
Production project references a test project: druid-compressed-bigdecimal → druid-processing (test-jar) — `druid-compressed-bigdecimal` (production) references the test project `druid-processing (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: druid-quidem-ut → druid-datasketches (test-jar) — `druid-quidem-ut` (production) references the test project `druid-datasketches (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: druid-quidem-ut → druid-multi-stage-query (test-jar) — `druid-quidem-ut` (production) references the test project `druid-multi-stage-query (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: druid-quidem-ut → druid-processing (test-jar) — `druid-quidem-ut` (production) references the test project `druid-processing (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: druid-quidem-ut → druid-server (test-jar) — `druid-quidem-ut` (production) references the test project `druid-server (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: druid-quidem-ut → druid-sql (test-jar) — `druid-quidem-ut` (production) references the test project `druid-sql (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: druid-redis-cache → druid-server (test-jar) — `druid-redis-cache` (production) references the test project `druid-server (test-jar)`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
D10 · Test Quality· No assertions (empty test) · ×5
No assertions (empty test): testMaxWaitTime indexing-service/src/test/java/org/apache/druid/indexing/common/actions/SegmentAllocationQueueTest.java:335— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): testPersistEmptyColumn processing/src/test/java/org/apache/druid/segment/RoaringBitmapIndexMergerV10Test.java:67— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): testPersistNullColumnSkipping processing/src/test/java/org/apache/druid/segment/RoaringBitmapIndexMergerV10Test.java:60— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): testPersistWithSegmentMetadata processing/src/test/java/org/apache/druid/segment/RoaringBitmapIndexMergerV10Test.java:53— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): test_openPartitionedChannel processing/src/test/java/org/apache/druid/frame/processor/BlockingQueueOutputChannelFactoryTest.java:33— Test method has an empty body — it asserts nothing and exercises no code.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×4
Click handler on a non-interactive <span> web-console/src/views/workbench-view/execution-progress-bar-pane/execution-progress-bar-pane.tsx:63— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <span> web-console/src/views/workbench-view/ingest-success-pane/ingest-success-pane.tsx:59— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <span> web-console/src/views/workbench-view/ingest-success-pane/ingest-success-pane.tsx:69— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <span> web-console/src/views/workbench-view/ingest-success-pane/ingest-success-pane.tsx:77— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×3
Click handler on a non-interactive <div> web-console/src/components/json-input/json-input.tsx:191— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> web-console/src/components/loader/loader.tsx:64— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> web-console/src/views/sql-data-loader-view/schema-step/column-list/expression-entry/expression-entry.tsx:45— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Boundary-crossing change coupling: ExpressionModule.java ↔ DruidOperatorTable.java processing/src/main/java/org/apache/druid/guice/ExpressionModule.java:1— `processing/src/main/java/org/apache/druid/guice/ExpressionModule.java` (context processing) and `sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java` (context sql) sit in DIFFERENT parts of the tree yet change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `307b8e33` feat: json_merge expression and sql function (#17081); `e64b92eb` add JSON_QUERY_ARRAY function to pluck ARRAY<COMPLEX<json>> out of CO…; `5fda8613` Feature: Add IPv6 Match Function (#15212) — run `git show` on any of them.
Boundary-crossing change coupling: TaskAction.java ↔ IndexerSQLMetadataStorageCoordinator.java indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskAction.java:1— `indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskAction.java` (context indexing-service) and `server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java` (context main) sit in DIFFERENT parts of the tree yet change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `7c89096b` feat: Block segment publish action for a streaming task until prior t…; `d6c760f7` Do not kill segments with referenced load specs from deep storage (#1…; `d9bd0225` Refactor: Rename UsedSegmentChecker and cleanup task actions (#16644) — run `git show` on any of them.
Boundary-crossing change coupling: TaskAction.java ↔ IndexerMetadataStorageCoordinator.java indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskAction.java:1— `indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskAction.java` (context indexing-service) and `server/src/main/java/org/apache/druid/indexing/overlord/IndexerMetadataStorageCoordinator.java` (context main) sit in DIFFERENT parts of the tree yet change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `d6c760f7` Do not kill segments with referenced load specs from deep storage (#1…; `d9bd0225` Refactor: Rename UsedSegmentChecker and cleanup task actions (#16644); `0fe6a2af` Fix replica task failures with metadata inconsistency while running c… — run `git show` on any of them.
AC4 · Keyboard semantics· Double-click handler on a non-interactive <div> · ×2
Double-click handler on a non-interactive <div> web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:164— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Double-click handler on a non-interactive <div> web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.tsx:230— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Banned license: org.openjdk.jmh:jmh-core — `org.openjdk.jmh:jmh-core` 1.37 is published on Maven Central under `GPL-2.0`, which this policy bans, and this repository declares it in a Maven or Gradle manifest. The licence was read from the artifact's POM `<REDACTED>` block — following `<parent>` where the POM inherits them — and normalised to SPDX before it was judged, because Maven publishes the name as free text (`GNU Affero General Public License v3` is AGPL-3.0). Where a POM lists several licences they are read as a CHOICE, per Maven's own documentation, so this is charged only because EVERY listed licence is banned. Replace the dependency, or record an accepted exception.
Banned license: org.openjdk.jmh:jmh-generator-annprocess — `org.openjdk.jmh:jmh-generator-annprocess` 1.37 is published on Maven Central under `GPL-2.0`, which this policy bans, and this repository declares it in a Maven or Gradle manifest. The licence was read from the artifact's POM `<REDACTED>` block — following `<parent>` where the POM inherits them — and normalised to SPDX before it was judged, because Maven publishes the name as free text (`GNU Affero General Public License v3` is AGPL-3.0). Where a POM lists several licences they are read as a CHOICE, per Maven's own documentation, so this is charged only because EVERY listed licence is banned. Replace the dependency, or record an accepted exception.
AC2 · Forms & labels· <textarea> without a programmatic label · ×1
<textarea> without a programmatic label web-console/src/components/show-log/show-log.tsx:196— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
Viewport restricts zoom web-console/unified-console.html:23— user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
AC4 · Keyboard semantics· Clickable role="separator" that no keyboard user can reach · ×1
Clickable role="separator" that no keyboard user can reach web-console/src/components/splitter-layout/splitter-layout.tsx:234— This <div> announces itself as a role="separator" and is operated by mousedown and touchstart, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
No assertions: testRunSkipIfLastRunLessThanPeriod server/src/test/java/org/apache/druid/server/coordinator/duty/KillAuditLogTest.java:64— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRunSkipIfLastRunLessThanPeriod server/src/test/java/org/apache/druid/server/coordinator/duty/KillDatasourceMetadataTest.java:69— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRunSkipIfLastRunLessThanPeriod server/src/test/java/org/apache/druid/server/coordinator/duty/KillRulesTest.java:64— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRunSkipIfLastRunLessThanPeriod server/src/test/java/org/apache/druid/server/coordinator/duty/KillSupervisorsTest.java:64— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCacheUtilizationIsEmittedPerTierAndPerAlias server/src/test/java/org/apache/druid/server/coordinator/simulate/HistoricalTierAliasTest.java:146— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCacheUtilizationSkipsTiersWithNoCapacity server/src/test/java/org/apache/druid/server/coordinator/simulate/HistoricalTierAliasTest.java:183— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCapacityMetricsAreTaggedWithAlias server/src/test/java/org/apache/druid/server/coordinator/simulate/HistoricalTierAliasTest.java:60— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCapacityMetricsHaveNoAliasWhenNotConfigured server/src/test/java/org/apache/druid/server/coordinator/simulate/HistoricalTierAliasTest.java:264— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testUsedStorageReportsOnlyBytesLoadedAndAnnounced server/src/test/java/org/apache/druid/server/coordinator/simulate/HistoricalTierAliasTest.java:114— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testSegmentsOvershadowedByZeroReplicaSegmentsAreMarkedAsUnused server/src/test/java/org/apache/druid/server/coordinator/simulate/MarkSegmentsAsUnusedTest.java:43— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testMaxSegmentsAreMovedWhenClusterIsSkewed server/src/test/java/org/apache/druid/server/coordinator/simulate/SegmentBalancingTest.java:283— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testBroadcastReplicasAreNotThrottled server/src/test/java/org/apache/druid/server/coordinator/simulate/SegmentLoadingTest.java:403— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLoadOfFullyReplicatedSegmentGetsCancelled server/src/test/java/org/apache/druid/server/coordinator/simulate/SegmentLoadingTest.java:366— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLoadOfUnusedSegmentIsCancelled server/src/test/java/org/apache/druid/server/coordinator/simulate/SegmentLoadingTest.java:493— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testMaxSegmentsInNodeLoadingQueue server/src/test/java/org/apache/druid/server/coordinator/simulate/SegmentLoadingTest.java:265— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testSomeBasicStuff server/src/test/java/org/apache/druid/server/coordinator/DruidCoordinatorConfigTest.java:419— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCoordinatorCustomDutyGroupsRunAsExpected server/src/test/java/org/apache/druid/server/coordinator/DruidCoordinatorTest.java:659— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testValidRequest server/src/test/java/org/apache/druid/server/http/security/PreResponseAuthorizationCheckFilterTest.java:45— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testSync_whenDruidNode_isNull server/src/test/java/org/apache/druid/server/http/CoordinatorDynamicConfigSyncerTest.java:144— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testSimpleSubmissionFailureWithWait extensions-core/lookups-cached-global/src/test/java/org/apache/druid/server/lookup/namespace/cache/CacheSchedulerTest.java:494— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCreateInstanceWhenUrlHasOnlyAllowedProperties extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcherUrlCheckTest.java:44— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testWhenUrlHasDisallowedPropertiesWhenNotEnforcingAllowedProperties extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcherUrlCheckTest.java:113— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCreateInstanceWhenUrlHasOnlyAllowedProperties extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcherUrlCheckTest.java:151— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testWhenUrlHasDisallowedPropertiesWhenNotEnforcingAllowedProperties extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcherUrlCheckTest.java:220— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testSkipUrlParsingWhenUnknownFormatIsAllowed extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcherUrlCheckTest.java:336— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
ClassTooLong: SeekableStreamSupervisor indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:161— ClassTooLong — 3201 significant lines (blank, comment-only and punctuation-only lines excluded), 150 methods. The bar is 400 significant lines; this is 2801 over it, 8.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LoadDataView web-console/src/views/load-data-view/load-data-view.tsx:482— ClassTooLong — 2527 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 400 significant lines; this is 2127 over it, 6.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Function processing/src/main/java/org/apache/druid/math/expr/Function.java:74— ClassTooLong — 2391 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 1991 over it, 5.98× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: QueryContextParameters processing/src/main/java/org/apache/druid/query/context/QueryContextParameters.java:85— ClassTooLong — 2160 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 1760 over it, 5.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IndexerSQLMetadataStorageCoordinator server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:103— ClassTooLong — 1705 significant lines (blank, comment-only and punctuation-only lines excluded), 84 methods. The bar is 400 significant lines; this is 1305 over it, 4.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SegmentLocalCacheManager server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:84— ClassTooLong — 1359 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 959 over it, 3.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SeekableStreamIndexTaskRunner indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:151— ClassTooLong — 1339 significant lines (blank, comment-only and punctuation-only lines excluded), 86 methods. The bar is 400 significant lines; this is 939 over it, 3.35× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RowBasedGrouperHelper processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:114— ClassTooLong — 1310 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 910 over it, 3.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SqlSegmentsMetadataQuery server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:88— ClassTooLong — 1193 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 793 over it, 2.98× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ParallelIndexSupervisorTask indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:139— ClassTooLong — 1165 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods. The bar is 400 significant lines; this is 765 over it, 2.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CompactionTask indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:151— ClassTooLong — 1155 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 755 over it, 2.89× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DatasourcesView web-console/src/views/datasources-view/datasources-view.tsx:340— ClassTooLong — 1137 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 737 over it, 2.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HttpRemoteTaskRunner indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:126— ClassTooLong — 1081 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 681 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StreamAppenderator server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:119— ClassTooLong — 1048 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 648 over it, 2.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IndexTask indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:131— ClassTooLong — 1045 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 645 over it, 2.61× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NestedFieldColumnIndexSupplier processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:91— ClassTooLong — 1019 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 619 over it, 2.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TaskLockbox indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:89— ClassTooLong — 1007 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 607 over it, 2.52× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DruidQuery sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:132— ClassTooLong — 992 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 592 over it, 2.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ConciseSet processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:54— ClassTooLong — 952 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 552 over it, 2.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DruidDatabaseMetaData jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:40— ClassTooLong — 945 significant lines (blank, comment-only and punctuation-only lines excluded), 180 methods. The bar is 400 significant lines; this is 545 over it, 2.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NestedFieldVirtualColumn processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:117— ClassTooLong — 945 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 545 over it, 2.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SupervisorsView web-console/src/views/supervisors-view/supervisors-view.tsx:256— ClassTooLong — 882 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 482 over it, 2.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ApproximateHistogram extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:36— ClassTooLong — 862 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 462 over it, 2.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ExprEval processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:45— ClassTooLong — 845 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 445 over it, 2.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DruidResultSet jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidResultSet.java:73— ClassTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded), 211 methods. The bar is 400 significant lines; this is 437 over it, 2.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
FileTooLong: supervisor/SeekableStreamSupervisor.java indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java— FileTooLong — 3324 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SeekableStreamSupervisor (161-5860). The bar is 500 significant lines; this is 2824 over it, 6.65× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: load-data-view/load-data-view.tsx web-console/src/views/load-data-view/load-data-view.tsx— FileTooLong — 2914 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: LoadDataView (482-3802). The bar is 500 significant lines; this is 2414 over it, 5.83× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: expr/Function.java processing/src/main/java/org/apache/druid/math/expr/Function.java— FileTooLong — 2436 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: Function (74-4791). The bar is 500 significant lines; this is 1936 over it, 4.87× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: context/QueryContextParameters.java processing/src/main/java/org/apache/druid/query/context/QueryContextParameters.java— FileTooLong — 2194 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: QueryContextParameters (85-2769). The bar is 500 significant lines; this is 1694 over it, 4.39× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: exec/ControllerImpl.java multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java— FileTooLong — 1864 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1364 over it, 3.73× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: metadata/IndexerSQLMetadataStorageCoordinator.java server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java— FileTooLong — 1782 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: IndexerSQLMetadataStorageCoordinator (103-2884). The bar is 500 significant lines; this is 1282 over it, 3.56× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: seekablestream/SeekableStreamIndexTaskRunner.java indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java— FileTooLong — 1460 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: SeekableStreamIndexTaskRunner (151-2484). The bar is 500 significant lines; this is 960 over it, 2.92× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: loading/SegmentLocalCacheManager.java server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java— FileTooLong — 1417 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SegmentLocalCacheManager (84-2624). The bar is 500 significant lines; this is 917 over it, 2.83× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: datasources-view/datasources-view.tsx web-console/src/views/datasources-view/datasources-view.tsx— FileTooLong — 1405 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: DatasourcesView (340-1854). The bar is 500 significant lines; this is 905 over it, 2.81× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: epinephelinae/RowBasedGrouperHelper.java processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java— FileTooLong — 1398 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: RowBasedGrouperHelper (114-2230). The bar is 500 significant lines; this is 898 over it, 2.80× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: task/CompactionTask.java indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java— FileTooLong — 1278 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: CompactionTask (151-2006). The bar is 500 significant lines; this is 778 over it, 2.56× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: parallel/ParallelIndexSupervisorTask.java indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java— FileTooLong — 1274 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: ParallelIndexSupervisorTask (139-2048). The bar is 500 significant lines; this is 774 over it, 2.55× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: metadata/SqlSegmentsMetadataQuery.java server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java— FileTooLong — 1253 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: SqlSegmentsMetadataQuery (88-2233). The bar is 500 significant lines; this is 753 over it, 2.51× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: hrtr/HttpRemoteTaskRunner.java indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java— FileTooLong — 1174 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: HttpRemoteTaskRunner (126-1921). The bar is 500 significant lines; this is 674 over it, 2.35× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: task/IndexTask.java indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java— FileTooLong — 1153 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: IndexTask (131-1707). The bar is 500 significant lines; this is 653 over it, 2.31× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: appenderator/StreamAppenderator.java server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java— FileTooLong — 1144 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: StreamAppenderator (119-1889). The bar is 500 significant lines; this is 644 over it, 2.29× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: rel/DruidQuery.java sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java— FileTooLong — 1097 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: DruidQuery (132-1838). The bar is 500 significant lines; this is 597 over it, 2.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: nested/NestedFieldColumnIndexSupplier.java processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java— FileTooLong — 1083 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: NestedFieldColumnIndexSupplier (91-1732). The bar is 500 significant lines; this is 583 over it, 2.17× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: supervisors-view/supervisors-view.tsx web-console/src/views/supervisors-view/supervisors-view.tsx— FileTooLong — 1077 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: SupervisorsView (256-1424). The bar is 500 significant lines; this is 577 over it, 2.15× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: overlord/TaskLockbox.java indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java— FileTooLong — 1059 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: TaskLockbox (89-1920). The bar is 500 significant lines; this is 559 over it, 2.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: virtual/NestedFieldVirtualColumn.java processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java— FileTooLong — 1020 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: NestedFieldVirtualColumn (117-1672). The bar is 500 significant lines; this is 520 over it, 2.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: services-view/services-view.tsx web-console/src/views/services-view/services-view.tsx— FileTooLong — 980 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: ServicesView (406-1340). The bar is 500 significant lines; this is 480 over it, 1.96× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: intset/ConciseSet.java processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java— FileTooLong — 961 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ConciseSet (54-2183). The bar is 500 significant lines; this is 461 over it, 1.92× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: jdbc/DruidDatabaseMetaData.java jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java— FileTooLong — 959 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: DruidDatabaseMetaData (40-1650). The bar is 500 significant lines; this is 459 over it, 1.92× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: segments-view/segments-view.tsx web-console/src/views/segments-view/segments-view.tsx— FileTooLong — 936 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: SegmentsView (259-1224). The bar is 500 significant lines; this is 436 over it, 1.87× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
TooManyMethods: DruidResultSet jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidResultSet.java:73— TooManyMethods — 211 methods. The bar is 30 methods; this is 181 over it, 7.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DruidDatabaseMetaData jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:40— TooManyMethods — 180 methods. The bar is 30 methods; this is 150 over it, 6.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SeekableStreamSupervisor indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:161— TooManyMethods — 150 methods. The bar is 30 methods; this is 120 over it, 5.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: QueryContext processing/src/main/java/org/apache/druid/query/QueryContext.java:63— TooManyMethods — 103 methods. The bar is 30 methods; this is 73 over it, 3.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SeekableStreamIndexTaskRunner indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:151— TooManyMethods — 86 methods. The bar is 30 methods; this is 56 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IndexerSQLMetadataStorageCoordinator server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:103— TooManyMethods — 84 methods. The bar is 30 methods; this is 54 over it, 2.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ParallelIndexSupervisorTask indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:139— TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DruidPreparedStatement jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidPreparedStatement.java:70— TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SqlSegmentsMetadataQuery server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:88— TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SQLMetadataConnector server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:71— TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ControllerImpl multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:231— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LoadDataView web-console/src/views/load-data-view/load-data-view.tsx:482— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DruidConnection jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnection.java:58— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PlannerContext sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java:96— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DefaultQueryMetrics processing/src/main/java/org/apache/druid/query/DefaultQueryMetrics.java:43— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. Most of these members implement query.QueryMetrics (53 of 59 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: SafeWritableBuffer processing/src/main/java/org/apache/druid/segment/data/SafeWritableBuffer.java:39— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ApproximateHistogram extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:36— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IntervalTreeMap processing/src/main/java/org/apache/druid/timeline/IntervalTreeMap.java:70— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SegmentLocalCacheManager server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:84— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HttpRemoteTaskRunner indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:126— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GroupByQuery processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:90— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DefaultSearchQueryMetrics processing/src/main/java/org/apache/druid/query/search/DefaultSearchQueryMetrics.java:35— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. Most of these members implement query.QueryMetrics (54 of 56 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: DataSegment processing/src/main/java/org/apache/druid/timeline/DataSegment.java:63— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BloomKFilter extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:62— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CoordinatorBasicAuthorizerMetadataStorageUpdater extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:75— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
MethodTooLong: DatasourcesView.renderDatasourcesTable web-console/src/views/datasources-view/datasources-view.tsx:1177— MethodTooLong — renderDatasourcesTable runs 431 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 331 over it, 4.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SeekableStreamIndexTaskRunner.runInternal indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:426— MethodTooLong — runInternal runs 367 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 267 over it, 3.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DirectDruidClient.run server/src/main/java/org/apache/druid/client/DirectDruidClient.java:162— MethodTooLong — run runs 364 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 264 over it, 3.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SegmentsView.renderSegmentsTable web-console/src/views/segments-view/segments-view.tsx:600— MethodTooLong — renderSegmentsTable runs 336 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 236 over it, 3.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ColumnTree.getDerivedStateFromProps web-console/src/views/workbench-view/column-tree/column-tree.tsx:213— MethodTooLong — getDerivedStateFromProps runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LoadDataView.renderSchemaStep web-console/src/views/load-data-view/load-data-view.tsx:2401— MethodTooLong — renderSchemaStep runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: JettyServerModule.makeAndInitializeServer server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java:181— MethodTooLong — makeAndInitializeServer runs 220 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NettyHttpClient.go processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java:107— MethodTooLong — go runs 218 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Expressions.toSimpleLeafFilter sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:516— MethodTooLong — toSimpleLeafFilter runs 218 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CliOverlord.getModules services/src/main/java/org/apache/druid/cli/CliOverlord.java:204— MethodTooLong — getModules runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ForkingTaskRunner.run indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:169— MethodTooLong — run runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: 7383.call indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:179— MethodTooLong — call runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PooledTopNAlgorithm.scanAndAggregateDefault processing/src/main/java/org/apache/druid/query/topn/PooledTopNAlgorithm.java:491— MethodTooLong — scanAndAggregateDefault runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FrameProcessorExecutor.runFully processing/src/main/java/org/apache/druid/frame/processor/FrameProcessorExecutor.java:113— MethodTooLong — runFully runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IndexMergerV10.makeIndexFiles processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:98— MethodTooLong — makeIndexFiles runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DatasourcesView.constructor web-console/src/views/datasources-view/datasources-view.tsx:421— MethodTooLong — constructor runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TasksView.renderTaskTable web-console/src/views/tasks-view/tasks-view.tsx:374— MethodTooLong — renderTaskTable runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MemcachedCache.create server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:107— MethodTooLong — create runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IndexMergerV10.makeClusteredIndexFiles processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:359— MethodTooLong — makeClusteredIndexFiles runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HttpRemoteTaskRunner.taskAddedOrUpdated indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1445— MethodTooLong — taskAddedOrUpdated runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ServiceClientImpl.tryRequest server/src/main/java/org/apache/druid/rpc/ServiceClientImpl.java:124— MethodTooLong — tryRequest runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IndexTask.generateAndPublishSegments indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:810— MethodTooLong — generateAndPublishSegments runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AutoTypeColumnMerger.writeMergedValueDictionary processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:127— MethodTooLong — writeMergedValueDictionary runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LoadDataView.renderParserStep web-console/src/views/load-data-view/load-data-view.tsx:1535— MethodTooLong — renderParserStep runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LoadDataView.renderConnectStep web-console/src/views/load-data-view/load-data-view.tsx:1290— MethodTooLong — renderConnectStep runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (7 lines × 2) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:77— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:77-83 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentMover.java:74-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:208— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:208-214 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:274-280 — before extracting anything, compare `extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java` and `extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/SendAllGraphiteEventConverter.java:101— extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/SendAllGraphiteEventConverter.java:101-107 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:213-219 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java:87— extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java:87-93 | extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentPusher.java:302-308 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:107— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:107-113 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:107-113 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregatorFactory.java:273— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregatorFactory.java:273-279 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchMergeAggregatorFactory.java:172-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchMergeAggregatorFactory.java:172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:118— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:118-124 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3ExportStorageProvider.java:173-179 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregator.java:75— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregator.java:75-81 | processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanVectorAggregator.java:74-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregator.java:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:187— indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:187-193 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:172-178 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:207— indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:207-213 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/SimpleWorkerProvisioningStrategy.java:152-158 — before extracting anything, compare `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java` and `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/SimpleWorkerProvisioningStrategy.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:207` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:214` calls `info`, `getNodeIds`, `size` and `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/SimpleWorkerProvisioningStrategy.java:159` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:240— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:240-246 | server/src/main/java/org/apache/druid/server/http/CoordinatorResource.java:71-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:240` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1872— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1872-1878 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1946-1952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1872` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5770— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5770-5776 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5778-5784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5770` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:883— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:883-889 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1364-1370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:371— processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:371-377 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:593-599 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:371` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorConditionalProcessors.java:121— processing/src/main/java/org/apache/druid/math/expr/vector/VectorConditionalProcessors.java:121-128 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorConditionalProcessors.java:149-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorConditionalProcessors.java:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:939— processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:939-945 | processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryEngine.java:330-336 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:939` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `query` to `GroupByQuery` in one and `TimeseriesQuery` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:946` calls `setGroupingColumns`, `getGroupingColumns` and `processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryEngine.java:337` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:287— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:287-293 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:346-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:571— processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:571-577 | processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java:285-291 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:571` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:77— processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:77-83 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:85-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:193— processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:193-199 | processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:241-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:566— processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:566-572 | processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:776-782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:281— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:281-287 | processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java:251-257 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java` and `processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:281` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/segment/QueryableIndexPhysicalSegmentInspector.java:55— processing/src/main/java/org/apache/druid/segment/QueryableIndexPhysicalSegmentInspector.java:55-61 | processing/src/main/java/org/apache/druid/segment/QueryableIndexPhysicalSegmentInspector.java:71-77 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/QueryableIndexPhysicalSegmentInspector.java:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java:258— processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java:258-265 | processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java:422-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java:258` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java:419` calls `clear`, `isDirect` and `processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java:257` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:197— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:197-204 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java:290-297 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:115— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:115-122 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/BuiltinApproxCountDistinctSqlAggregator.java:94-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:115— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:115-122 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:129-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:115` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:124` calls `initializeSketchIfNeeded` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:138` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/expressions/BloomFilterExpressions.java:118— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/expressions/BloomFilterExpressions.java:118-125 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/expressions/BloomFilterExpressions.java:259-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/expressions/BloomFilterExpressions.java:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:224— indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:224-231 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:204-211 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/worker/shuffle/DeepStorageIntermediaryDataManager.java:74— indexing-service/src/main/java/org/apache/druid/indexing/worker/shuffle/DeepStorageIntermediaryDataManager.java:74-81 | indexing-service/src/main/java/org/apache/druid/indexing/worker/shuffle/LocalIntermediaryDataManager.java:294-301 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:239— indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:239-246 | indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:264-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/SegmentGenerationUtils.java:252— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/SegmentGenerationUtils.java:252-259 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/SegmentGenerationUtils.java:379-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/java/util/metrics/CgroupDiskMonitor.java:93— processing/src/main/java/org/apache/druid/java/util/metrics/CgroupDiskMonitor.java:93-100 | processing/src/main/java/org/apache/druid/java/util/metrics/CgroupV2DiskMonitor.java:87-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/metrics/CgroupDiskMonitor.java:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/math/expr/Function.java:4049— processing/src/main/java/org/apache/druid/math/expr/Function.java:4049-4056 | processing/src/main/java/org/apache/druid/math/expr/Function.java:4185-4192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/math/expr/Function.java:4058` calls `isArray` and `processing/src/main/java/org/apache/druid/math/expr/Function.java:4193` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongProcessor.java:68— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongProcessor.java:68-75 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongProcessor.java:66-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java:372— processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java:372-379 | processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java:405-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java:372` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:183— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:183-190 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java:177-184 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:177— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:177-184 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java:175-182 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:176— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:176-183 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastAggregatorFactory.java:174-181 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastAggregatorFactory.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/post/JavaScriptPostAggregator.java:55— processing/src/main/java/org/apache/druid/query/aggregation/post/JavaScriptPostAggregator.java:55-62 | processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java:42-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java:101— processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java:101-108 | processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java:122-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexIO.java:978— processing/src/main/java/org/apache/druid/segment/IndexIO.java:978-985 | processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:147-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:474— processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:474-481 | processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java:302-309 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java` and `processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:102— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:102-109 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:81-88 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:416— processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:416-423 | processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:454-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:416` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarInts.java:198— processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarInts.java:198-205 | processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarMultiInts.java:174-181 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarInts.java:198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:612— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:612-619 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:683-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:612` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:69— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:69-76 | processing/src/main/java/org/apache/druid/segment/nested/ScalarStringColumnAndIndexSupplier.java:56-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:76— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:76-83 | processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplierV4.java:83-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPusher.java:68— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPusher.java:68-76 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPusher.java:95-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPusher.java:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:376— extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:376-384 | extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeDiscoveryProvider.java:331-339 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/DeltaInputSource.java:166— extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/DeltaInputSource.java:166-174 | extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/DeltaInputSource.java:224-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/DeltaInputSource.java:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:231— extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:231-239 | extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:324-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:231` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/sql/ArrayOfDoublesSketchSetBaseOperatorConversion.java:89— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/sql/ArrayOfDoublesSketchSetBaseOperatorConversion.java:89-97 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/sql/ArrayOfDoublesSketchSqlAggregator.java:87-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:995— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:995-1003 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1067-1075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1031— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1031-1039 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1103-1111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:412— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:412-420 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:515-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CachedMetadataCatalog.java:240— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CachedMetadataCatalog.java:240-248 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CachedMetadataCatalog.java:254-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:86— extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:86-94 | extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:129-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:694— indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:694-702 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:767-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:151— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:151-159 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java:199-207 — before extracting anything, compare `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java` and `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:145— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:145-153 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:184-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:315— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:315-323 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:337-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:315` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:492— indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:492-500 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:678-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:492` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:115— processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:115-123 | processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java:132-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:204— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:204-212 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:203-211 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java:443— processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java:443-451 | processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java:466-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java:443` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/java/util/metrics/JvmCpuMonitor.java:78— processing/src/main/java/org/apache/druid/java/util/metrics/JvmCpuMonitor.java:78-86 | server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsMonitor.java:77-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/metrics/JvmCpuMonitor.java:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Disk.java:61— processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Disk.java:61-69 | processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Disk.java:84-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Disk.java:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/math/expr/Expr.java:828— processing/src/main/java/org/apache/druid/math/expr/Expr.java:828-836 | processing/src/main/java/org/apache/druid/math/expr/Expr.java:851-859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/Expr.java:828` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java:84— processing/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java:84-92 | processing/src/main/java/org/apache/druid/math/expr/vector/FunctionErrorReportingExprVectorProcessor.java:49-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/AbstractSerializablePairLongObjectDeltaEncodedStagedSerde.java:76— processing/src/main/java/org/apache/druid/query/aggregation/AbstractSerializablePairLongObjectDeltaEncodedStagedSerde.java:76-84 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:71-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:237— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:237-245 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:101-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:109` calls `fromUtf8` and `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:245` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java:86— processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java:86-94 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/SingleValueStringCardinalityVectorProcessor.java:77-85 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java` and `processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/SingleValueStringCardinalityVectorProcessor.java` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
+ 40 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×63
Edited copy of a member (10 corresponding lines) server/src/main/java/org/apache/druid/server/http/ServersResource.java:54— server/src/main/java/org/apache/druid/server/http/ServersResource.java:54-63 | server/src/main/java/org/apache/druid/server/http/ServersResource.java:66-76 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/indexer/TaskLocation.java:161— processing/src/main/java/org/apache/druid/indexer/TaskLocation.java:161-170 | server/src/main/java/org/apache/druid/rpc/ServiceLocation.java:234-246 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/segment/projections/RollupTableProjectionSchema.java:200— processing/src/main/java/org/apache/druid/segment/projections/RollupTableProjectionSchema.java:200-209 | processing/src/main/java/org/apache/druid/segment/projections/TableProjectionSchema.java:198-207 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:112— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:112-121 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java:86-95 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:391— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:391-400 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:353-368 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:472— processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:472-481 | processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:512-521 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:540— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:540-549 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:560-569 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/query/http/ClientSqlParameter.java:63— processing/src/main/java/org/apache/druid/query/http/ClientSqlParameter.java:63-72 | sql/src/main/java/org/apache/druid/sql/http/SqlParameter.java:129-139 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/rules/WildcardClusterGroupPartialLoadMatcher.java:174— server/src/main/java/org/apache/druid/server/coordinator/rules/WildcardClusterGroupPartialLoadMatcher.java:174-185 | server/src/main/java/org/apache/druid/server/coordinator/rules/WildcardProjectionPartialLoadMatcher.java:113-122 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:969— processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:969-981 | processing/src/main/java/org/apache/druid/segment/file/SegmentFileMapperV10.java:212-221 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) server/src/main/java/org/apache/druid/server/http/RulesResource.java:131— server/src/main/java/org/apache/druid/server/http/RulesResource.java:131-140 | server/src/main/java/org/apache/druid/server/http/RulesResource.java:150-159 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:98— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:98-108 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java:73-82 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/stats/DropwizardRowIngestionMeters.java:124— indexing-service/src/main/java/org/apache/druid/indexing/common/stats/DropwizardRowIngestionMeters.java:124-133 | processing/src/main/java/org/apache/druid/segment/incremental/SimpleRowIngestionMeters.java:100-109 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/NonnullPair.java:39— processing/src/main/java/org/apache/druid/java/util/common/NonnullPair.java:39-49 | processing/src/main/java/org/apache/druid/java/util/common/Pair.java:51-60 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/parsers/JavaScriptParser.java:49— processing/src/main/java/org/apache/druid/java/util/common/parsers/JavaScriptParser.java:49-58 | processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java:56-65 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/frame/key/KeyColumn.java:66— processing/src/main/java/org/apache/druid/frame/key/KeyColumn.java:66-75 | processing/src/main/java/org/apache/druid/query/OrderBy.java:93-102 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/RegexFilter.java:96— processing/src/main/java/org/apache/druid/segment/filter/RegexFilter.java:96-105 | processing/src/main/java/org/apache/druid/segment/filter/RegexFilter.java:159-171 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcStructFlattenerMaker.java:49— extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcStructFlattenerMaker.java:49-58 | extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupFlattenerMaker.java:47-56 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/IPv4AddressMatchExprMacro.java:134— processing/src/main/java/org/apache/druid/query/expression/IPv4AddressMatchExprMacro.java:134-143 | processing/src/main/java/org/apache/druid/query/expression/IPv6AddressMatchExprMacro.java:113-122 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureInputSource.java:76— extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureInputSource.java:76-85 | extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureStorageAccountInputSource.java:83-97 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/logical/DruidLogicalToQueryDefinitionTranslator.java:143— multi-stage-query/src/main/java/org/apache/druid/msq/logical/DruidLogicalToQueryDefinitionTranslator.java:143-152 | sql/src/main/java/org/apache/druid/sql/calcite/planner/querygen/DruidQueryGenerator.java:161-171 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:147— processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:147-158 | processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:256-265 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeVectorAggregator.java:63— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeVectorAggregator.java:63-72 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/ObjectHllSketchBuildVectorProcessor.java:53-66 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueryTool.java:117— indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueryTool.java:117-126 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueryTool.java:140-149 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:450— processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:450-459 | processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:810-819 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (6 lines × 2) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java:33— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java:33-38 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanNoNullAverager.java:33-38 — before extracting anything, compare `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java` and `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanNoNullAverager.java` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanAverager.java:33— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanAverager.java:33-38 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanNoNullAverager.java:33-38 — before extracting anything, compare `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanAverager.java` and `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanNoNullAverager.java` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanAverager.java:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:199— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:199-204 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:230-235 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:199` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:227— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:227-232 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:678-684 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:227` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:316— extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:316-321 | extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:446-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:316` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:509— indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:509-514 | server/src/main/java/org/apache/druid/server/http/BaseDynamicConfigSyncer.java:270-275 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:509` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:505` calls `shouldEmit` and `server/src/main/java/org/apache/druid/server/http/BaseDynamicConfigSyncer.java:269` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1759— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1759-1764 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1788-1793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1759` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/java/util/common/parsers/JavaScriptParser.java:51— processing/src/main/java/org/apache/druid/java/util/common/parsers/JavaScriptParser.java:51-56 | processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java:58-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:425— processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:425-430 | processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:433-438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:425` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateLongProcessorFactory.java:40— processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateLongProcessorFactory.java:40-45 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateProcessorFactory.java:41-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateLongProcessorFactory.java:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:206— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:206-213 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregatorFactory.java:179-184 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:665— processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:665-670 | processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:678-683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:665` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:989— processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:989-994 | processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:998-1003 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:989` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:244— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:244-249 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:330-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:285— processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:285-290 | processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:299-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:285` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndexSegment.java:112— processing/src/main/java/org/apache/druid/segment/PartialQueryableIndexSegment.java:112-117 | processing/src/main/java/org/apache/druid/segment/QueryableIndexSegment.java:86-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndexSegment.java:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/QueryableIndexSegment.java:92` calls `equals`, `getMetadata` and `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndexSegment.java:118` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:783— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:783-788 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1080-1085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:783` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:154— processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:154-161 | processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:295-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:563— server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:563-568 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:622-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:563` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) server/src/main/java/org/apache/druid/server/coordinator/rules/CompositePartialLoadMatcher.java:162— server/src/main/java/org/apache/druid/server/coordinator/rules/CompositePartialLoadMatcher.java:162-167 | server/src/main/java/org/apache/druid/server/coordinator/rules/ProjectionPartialLoadMatcher.java:88-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/coordinator/rules/CompositePartialLoadMatcher.java:162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) sql/src/main/java/org/apache/druid/sql/http/CsvWriter.java:79— sql/src/main/java/org/apache/druid/sql/http/CsvWriter.java:79-84 | sql/src/main/java/org/apache/druid/sql/http/CsvWriter.java:105-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/http/CsvWriter.java:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java:36— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java:36-41 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleSumAverager.java:34-39 — before extracting anything, compare `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java` and `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleSumAverager.java` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanAverager.java:36— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanAverager.java:36-41 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongSumAverager.java:34-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanAverager.java:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMapping.java:91— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMapping.java:91-96 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMappingFull.java:90-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleFull.java:90— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleFull.java:90-95 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleSimplifiedPermissions.java:122-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleFull.java:96` calls `getGroups`, `equals` and `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleSimplifiedPermissions.java:128` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:287— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:287-297 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:336-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:185— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:185-195 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:219-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:185` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/execution/KubernetesTaskExecutionConfigResource.java:95— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/execution/KubernetesTaskExecutionConfigResource.java:95-105 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:445-455 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/execution/KubernetesTaskExecutionConfigResource.java:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/execution/KubernetesTaskExecutionConfigResource.java:129— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/execution/KubernetesTaskExecutionConfigResource.java:129-139 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:472-482 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/execution/KubernetesTaskExecutionConfigResource.java:129` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:194— indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:194-204 | indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolboxFactory.java:181-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
Duplicated block (11 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:917— indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:917-927 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:956-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:917` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1548— indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1548-1558 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1597-1607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1548` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:230— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:230-240 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:255-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamDataSourceMetadata.java:86— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamDataSourceMetadata.java:86-96 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamDataSourceMetadata.java:104-114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:972— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:972-982 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:998-1008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:986` calls `getCause` and `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:1009` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2403— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2403-2413 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2435-2445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2403` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java:81— multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java:81-91 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryKit.java:85-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java:79` calls `validateQuery` and `multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryKit.java:84` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:196— processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:196-206 | processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java:201-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:80— processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:80-90 | processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:161-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:160` calls `createStarted` and `processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:79` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:879— processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:879-889 | processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:956-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:879` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/math/expr/Function.java:4309— processing/src/main/java/org/apache/druid/math/expr/Function.java:4309-4319 | processing/src/main/java/org/apache/druid/math/expr/Function.java:4476-4486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/Function.java:4309` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:43— processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:43-53 | processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedLongVectorProcessor.java:43-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:43` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `thenVector` to `ExprEvalVector<double[]>` in one and `ExprEvalVector<long[]>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:59— processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:59-69 | processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedLongVectorProcessor.java:59-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:59` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `elseVector` to `ExprEvalVector<double[]>` in one and `ExprEvalVector<long[]>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalDoubleVector.java:62— processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalDoubleVector.java:62-72 | processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalLongVector.java:57-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalDoubleVector.java:62` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java:61— processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java:61-71 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleLongAggregatorFactory.java:67-77 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SimpleLongAggregatorFactory.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:94— processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:94-104 | processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyVectorAggregator.java:139-149 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/query/expression/IPv4AddressParseExprMacro.java:73— processing/src/main/java/org/apache/druid/query/expression/IPv4AddressParseExprMacro.java:73-83 | processing/src/main/java/org/apache/druid/query/expression/IPv4AddressStringifyExprMacro.java:72-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/expression/IPv4AddressParseExprMacro.java:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:86— processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:86-96 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:158-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `selector` to `SingleValueDimensionVectorSelector` in one and `MultiValueDimensionVectorSelector` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:55— processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:55-65 | processing/src/main/java/org/apache/druid/query/topn/Generic2AggPooledTopNScannerPrototype.java:58-68 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java` and `processing/src/main/java/org/apache/druid/query/topn/Generic2AggPooledTopNScannerPrototype.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/query/topn/Generic2AggPooledTopNScannerPrototype.java:69` calls `aggregate` and `processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:66` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:585— processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:585-595 | processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:799-809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
FunctionTooLong: schema-step.SchemaStep web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:265— FunctionTooLong — SchemaStep runs 653 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 553 over it, 6.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: result-table-pane.ResultTablePane web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:137— FunctionTooLong — ResultTablePane runs 457 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 357 over it, 4.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: run-panel.RunPanel web-console/src/views/workbench-view/run-panel/run-panel.tsx:184— FunctionTooLong — RunPanel runs 446 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 346 over it, 4.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: console-table.ConsoleTable web-console/src/components/console-table/console-table.tsx:347— FunctionTooLong — ConsoleTable runs 400 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 300 over it, 4.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: header-bar.HeaderBar web-console/src/components/header-bar/header-bar.tsx:72— FunctionTooLong — HeaderBar runs 364 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 264 over it, 3.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: explore-view.ExploreView web-console/src/views/explore-view/explore-view.tsx:114— FunctionTooLong — ExploreView runs 320 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 220 over it, 3.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: generic-output-table.GenericOutputTable web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:118— FunctionTooLong — GenericOutputTable runs 295 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 195 over it, 2.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: control-pane.ControlPane web-console/src/views/explore-view/components/control-pane/control-pane.tsx:67— FunctionTooLong — ControlPane runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: segment-timeline.SegmentTimeline web-console/src/components/segment-timeline/segment-timeline.tsx:81— FunctionTooLong — SegmentTimeline runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: resource-pane.ResourcePane web-console/src/views/explore-view/components/resource-pane/resource-pane.tsx:80— FunctionTooLong — ResourcePane runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: input-source-step.InputSourceStep web-console/src/views/workbench-view/input-source-step/input-source-step.tsx:79— FunctionTooLong — InputSourceStep runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: continuous-chart-single-render.ContinuousChartSingleRender web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-single-render.tsx:70— FunctionTooLong — ContinuousChartSingleRender runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: supervisor-to-sql-dialog.SupervisorToSqlDialog web-console/src/dialogs/supervisor-to-sql-dialog/supervisor-to-sql-dialog.tsx:49— FunctionTooLong — SupervisorToSqlDialog runs 204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: input-format-step.InputFormatStep web-console/src/views/workbench-view/input-format-step/input-format-step.tsx:92— FunctionTooLong — InputFormatStep runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: measure-menu.MeasureMenu web-console/src/views/explore-view/components/control-pane/measure-menu.tsx:56— FunctionTooLong — MeasureMenu runs 196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: module-pane.ModulePane web-console/src/views/explore-view/components/module-pane/module-pane.tsx:106— FunctionTooLong — ModulePane runs 196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: input-format.generateInputFormatFields web-console/src/druid-models/input-format/input-format.tsx:73— FunctionTooLong — generateInputFormatFields runs 194 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 94 over it, 1.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: auto-scaler-panel.AutoScalerPanel web-console/src/dialogs/supervisor-table-action-dialog/auto-scaler-panel/auto-scaler-panel.tsx:70— FunctionTooLong — AutoScalerPanel runs 193 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: table-query.makeJoinCompareTableQueryAndHints web-console/src/views/explore-view/utils/table-query.ts:557— FunctionTooLong — makeJoinCompareTableQueryAndHints runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: recent-query-task-panel.RecentQueryTaskPanel web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.tsx:84— FunctionTooLong — RecentQueryTaskPanel runs 175 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: column-actions.ColumnActions web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:39— FunctionTooLong — ColumnActions runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: explore-header-bar.ExploreHeaderBar web-console/src/views/explore-view/components/explore-header-ber/explore-header-bar.tsx:53— FunctionTooLong — ExploreHeaderBar runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: column-editor.ColumnEditor web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx:129— FunctionTooLong — ColumnEditor runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rollup-analysis-pane.RollupAnalysisPane web-console/src/views/sql-data-loader-view/schema-step/rollup-analysis-pane/rollup-analysis-pane.tsx:144— FunctionTooLong — RollupAnalysisPane runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: filter-pane.FilterPane web-console/src/views/explore-view/components/filter-pane/filter-pane.tsx:63— FunctionTooLong — FilterPane runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
+ 25 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×48
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:84— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:84-96 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:94-105 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java:201— processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java:201-212 | processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java:215-226 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:744— processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:744-755 | processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:914-926 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/segment/QueryableIndexPhysicalSegmentInspector.java:52— processing/src/main/java/org/apache/druid/segment/QueryableIndexPhysicalSegmentInspector.java:52-65 | processing/src/main/java/org/apache/druid/segment/QueryableIndexPhysicalSegmentInspector.java:70-81 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:297— processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:297-315 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:319-330 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) server/src/main/java/org/apache/druid/metadata/SQLMetadataSupervisorManager.java:243— server/src/main/java/org/apache/druid/metadata/SQLMetadataSupervisorManager.java:243-254 | server/src/main/java/org/apache/druid/metadata/SQLMetadataSupervisorManager.java:258-269 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:108— processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:108-119 | processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:158-169 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/query/operator/window/ranking/WindowCumeDistProcessor.java:47— processing/src/main/java/org/apache/druid/query/operator/window/ranking/WindowCumeDistProcessor.java:47-59 | processing/src/main/java/org/apache/druid/query/operator/window/ranking/WindowDenseRankProcessor.java:47-58 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:202— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:202-213 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapter.java:194-205 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnectionUrl.java:192— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnectionUrl.java:192-203 | server/src/main/java/org/apache/druid/client/indexing/IndexingWorker.java:86-98 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:161— processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:161-172 | processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:182-202 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/segment/column/ObjectStrategyComplexTypeStrategy.java:90— processing/src/main/java/org/apache/druid/segment/column/ObjectStrategyComplexTypeStrategy.java:90-101 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:505-516 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskModule.java:40— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskModule.java:40-51 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexingServiceModule.java:45-58 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java:182— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java:182-193 | server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:85-101 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/input/external/ExternalInputSlice.java:83— multi-stage-query/src/main/java/org/apache/druid/msq/input/external/ExternalInputSlice.java:83-94 | sql/src/main/java/org/apache/druid/sql/calcite/external/ExternalDataSource.java:112-123 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/AggregatorAdapters.java:76— processing/src/main/java/org/apache/druid/query/aggregation/AggregatorAdapters.java:76-87 | processing/src/main/java/org/apache/druid/query/aggregation/AggregatorAdapters.java:96-107 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java:425— server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java:425-438 | server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java:441-452 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java:457— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java:457-468 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java:471-483 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) server/src/main/java/org/apache/druid/server/router/ConsistentHashAvaticaConnectionBalancer.java:35— server/src/main/java/org/apache/druid/server/router/ConsistentHashAvaticaConnectionBalancer.java:35-49 | server/src/main/java/org/apache/druid/server/router/RendezvousHashAvaticaConnectionBalancer.java:35-46 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/filter/IcebergAndFilter.java:65— extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/filter/IcebergAndFilter.java:65-76 | extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/filter/IcebergOrFilter.java:64-75 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:93— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:93-104 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:116-128 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:515— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:515-531 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:537-548 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java:230— processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java:230-245 | processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java:282-293 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) processing/src/main/java/org/apache/druid/timeline/TimelineObjectHolder.java:80— processing/src/main/java/org/apache/druid/timeline/TimelineObjectHolder.java:80-91 | server/src/main/java/org/apache/druid/metadata/ReplaceTaskLock.java:62-73 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesResourceEventNotifier.java:56— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesResourceEventNotifier.java:56-67 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesResourceEventNotifier.java:78-89 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
TodoComment web-console/src/views/explore-view/utils/filter-pattern-helpers.ts:130— // Todo: make this better — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment REDACTED:296— // ToDo — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment web-console/src/druid-models/input-source/input-source.tsx:99— // ToDo: these are not in the docs https://druid.apache.org/docs/latest/ingestion/input-sources
TodoComment web-console/src/druid-models/external-config/external-config.ts:61— // ToDo: make this official — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java:3663— // TODO: Remove expected Exception when https://github.com/apache/druid/issues/9942 is fixed
TodoComment sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java:4430— // TODO: Remove expected Exception when https://github.com/apache/druid/issues/9924 is fixed
TodoComment sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java:1718— // TODO: If needed, verify the first row here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java:1720— // TODO: Verify value types. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment sql/src/main/java/org/apache/druid/sql/calcite/run/NativeQueryMaker.java:132— // TODO: We can remove this once https://github.com/apache/druid/issues/9974 is done.
TodoComment processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQuery.java:186— // TODO: We can remove this once https://github.com/apache/druid/issues/9974 is done.
TodoComment sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRule.java:125— // TODO - add logic to derive additional filters. E.g., from — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment sql/src/main/java/org/apache/druid/sql/calcite/external/Externals.java:269— // TODO: Fix the underlying problem: we should not make assumptions about the input — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment sql/src/main/java/org/apache/druid/sql/calcite/external/ParameterizeOperator.java:60— // TODO Auto-generated method stub — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment server/src/test/java/org/apache/druid/metadata/segment/cache/HeapMemoryDatasourceSegmentCacheTest.java:213— // TODO: Assert.assertEquals(segmentId, cache.findHighestUnusedSegmentId(segment.getInterval(), segment.getVersion())); — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment server/src/main/java/org/apache/druid/query/RetryQueryRunner.java:159— // TODO: the sender's response may contain a truncated list of missing segments. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment server/src/main/java/org/apache/druid/catalog/model/SchemaRegistryImpl.java:43— // TODO: Change this when ExternalOperatorConvertion changes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment server/src/main/java/org/apache/druid/catalog/model/SchemaRegistryImpl.java:104— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment server/src/main/java/org/apache/druid/catalog/model/SchemaRegistryImpl.java:124— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment processing/src/test/java/org/apache/druid/segment/SchemalessTestSimpleTest.java:160— // @Test TODO: Handling of null values is inconsistent right now, need to make it all consistent and re-enable test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment processing/src/test/java/org/apache/druid/segment/SchemalessTestSimpleTest.java:161— // TODO: Complain to Eric when you see this. It shouldn't be like this... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment processing/src/test/java/org/apache/druid/query/topn/TopNQueryRunnerTest.java:3770— // TODO: fix this test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment processing/src/test/java/org/apache/druid/query/topn/TopNQueryRunnerTest.java:3783— // TODO: fix this test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment processing/src/test/java/org/apache/druid/hll/HyperLogLogCollectorBenchmark.java:47— // TODO understand if this field should be used or not — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment processing/src/test/java/org/apache/druid/frame/processor/ComposingOutputChannelFactoryTest.java:44— // TODO : currently hardcoded 256k since it allows one frame to be written to each factory — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment processing/src/test/java/org/apache/druid/frame/processor/OutputChannelFactoryTest.java:137— // TODO : this is bad. but it is because the input stream channel doesn't honor the contract of readibility future — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (10 lines × 2) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:116— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:116-125 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:144-153 — before extracting anything, compare `extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java` and `extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregatorHelper.java:91— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregatorHelper.java:91-100 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchBufferAggregatorHelper.java:84-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `Union` names `org.apache.datasketches.hll.Union` in one and `org.apache.datasketches.theta.Union` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:47— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:47-56 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java:47-56 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:47` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/DefaultBasicAuthorizerResourceHandler.java:198— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/DefaultBasicAuthorizerResourceHandler.java:198-207 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/DefaultBasicAuthorizerResourceHandler.java:216-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1376— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1376-1385 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1392-1401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:107— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:107-116 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:121-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:930— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:930-939 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1206-1215 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1217` calls `addAll` and `indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:941` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/TaskStatusResponse.java:61— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/TaskStatusResponse.java:61-70 | server/src/main/java/org/apache/druid/client/indexing/TaskStatusResponse.java:64-73 — before extracting anything, compare `indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/TaskStatusResponse.java` and `server/src/main/java/org/apache/druid/client/indexing/TaskStatusResponse.java` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1887— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1887-1896 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1961-1970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1887` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/OffsetLimitStageProcessor.java:98— multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/OffsetLimitStageProcessor.java:98-107 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/results/QueryResultStageProcessor.java:61-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/OffsetLimitStageProcessor.java:91` calls `workOrder`, `getWorkerNumber`, `ISE` and `multi-stage-query/src/main/java/org/apache/druid/msq/querykit/results/QueryResultStageProcessor.java:58` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java:129— processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java:129-138 | processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java:180-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalNumericBindingVector.java:105— processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalNumericBindingVector.java:105-114 | processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalNumericBindingVector.java:118-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectBindingVector.java:124— processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectBindingVector.java:124-133 | processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectVector.java:63-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectBindingVector.java:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleProcessor.java:65— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleProcessor.java:65-74 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleProcessor.java:68-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleProcessor.java:65` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:58— processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:58-67 | processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyVectorAggregator.java:159-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/query/expression/IPv4AddressMatchExprMacro.java:86— processing/src/main/java/org/apache/druid/query/expression/IPv4AddressMatchExprMacro.java:86-95 | processing/src/main/java/org/apache/druid/query/expression/IPv6AddressMatchExprMacro.java:75-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/expression/IPv4AddressMatchExprMacro.java:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/query/expression/IPv4AddressMatchExprMacro.java:97` calls `isNumericNull`, `isLongMatch`, `asLong` and `processing/src/main/java/org/apache/druid/query/expression/IPv6AddressMatchExprMacro.java:85` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:188— processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:188-197 | processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:199-208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/query/rowsandcols/ArrayListRowsAndColumns.java:482— processing/src/main/java/org/apache/druid/query/rowsandcols/ArrayListRowsAndColumns.java:482-491 | processing/src/main/java/org/apache/druid/query/rowsandcols/semantic/DefaultClusteredGroupPartitioner.java:84-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/rowsandcols/ArrayListRowsAndColumns.java:482` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java:220— processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java:220-229 | processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java:252-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java:220` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/query/topn/PooledTopNAlgorithm.java:145— processing/src/main/java/org/apache/druid/query/topn/PooledTopNAlgorithm.java:145-154 | processing/src/main/java/org/apache/druid/query/topn/PooledTopNAlgorithm.java:170-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/topn/PooledTopNAlgorithm.java:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarDoublesSuppliers.java:53— processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarDoublesSuppliers.java:53-62 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarFloatsSupplier.java:102-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarDoublesSuppliers.java:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarMultiIntsSupplier.java:119— processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarMultiIntsSupplier.java:119-128 | processing/src/main/java/org/apache/druid/segment/data/V3CompressedVSizeColumnarMultiIntsSupplier.java:97-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:217— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:217-226 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:272-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/segment/incremental/OnheapIncrementalIndex.java:250— processing/src/main/java/org/apache/druid/segment/incremental/OnheapIncrementalIndex.java:250-259 | processing/src/main/java/org/apache/druid/segment/incremental/OnheapIncrementalIndex.java:266-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1588— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1588-1597 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:361-370 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1588` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1599` calls `get` and `processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:372` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/InlineSchemasAvroBytesDecoder.java:117— extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/InlineSchemasAvroBytesDecoder.java:117-121 | extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRepoBasedAvroBytesDecoder.java:80-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/InlineSchemasAvroBytesDecoder.java:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchBuildBufferAggregatorHelper.java:60— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchBuildBufferAggregatorHelper.java:60-64 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchMergeBufferAggregatorHelper.java:69-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleStorageConnector.java:190— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleStorageConnector.java:190-194 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3StorageConnector.java:126-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:158— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:158-163 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java:189-193 — before extracting anything, compare `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentTransactionalInsertAction.java:330— indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentTransactionalInsertAction.java:330-334 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/TaskLockHelper.java:236-240 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/GlobalTaskLockbox.java:331— indexing-service/src/main/java/org/apache/druid/indexing/overlord/GlobalTaskLockbox.java:331-335 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/GlobalTaskLockbox.java:357-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1456— indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1456-1460 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1486-1491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1456` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:527— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:527-531 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:567-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:527` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:572` calls `get` and `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:532` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:235— multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:235-240 | multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlTaskResource.java:149-153 — before extracting anything, compare `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java` and `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlTaskResource.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:235` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/frame/write/RowBasedFrameWriterFactory.java:120— processing/src/main/java/org/apache/druid/frame/write/RowBasedFrameWriterFactory.java:120-124 | processing/src/main/java/org/apache/druid/frame/write/columnar/ColumnarFrameWriterFactory.java:84-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/write/RowBasedFrameWriterFactory.java:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateDoubleProcessorFactory.java:47— processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateDoubleProcessorFactory.java:47-51 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateProcessorFactory.java:48-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateDoubleProcessorFactory.java:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateLongProcessorFactory.java:57— processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateLongProcessorFactory.java:57-61 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateProcessorFactory.java:54-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateLongProcessorFactory.java:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:240— processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:240-244 | processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:366-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferHashTable.java:199— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferHashTable.java:199-203 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouper.java:555-560 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/segment/IncrementalIndexSegment.java:66— processing/src/main/java/org/apache/druid/segment/IncrementalIndexSegment.java:66-70 | processing/src/main/java/org/apache/druid/segment/QueryableIndexSegment.java:92-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/IncrementalIndexSegment.java:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:267— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:267-271 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:209-213 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `ByteBuffer` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:302— processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:302-306 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:399-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:302` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:84— server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:84-89 | server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:269-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:83` calls `containsKey` and `server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:268` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java:192— sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java:192-196 | sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java:224-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMapping.java:40— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMapping.java:40-44 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMappingFull.java:40-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufFlattenerMaker.java:63— extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufFlattenerMaker.java:63-67 | processing/src/main/java/org/apache/druid/java/util/common/parsers/JSONFlattenerMaker.java:62-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerFailedFault.java:46— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerFailedFault.java:46-50 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerRpcFailedFault.java:44-48 — before extracting anything, compare `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerFailedFault.java` and `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerRpcFailedFault.java` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniqueFinalizingPostAggregator.java:148— processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniqueFinalizingPostAggregator.java:148-152 | processing/src/main/java/org/apache/druid/query/aggregation/post/FinalizingFieldAccessPostAggregator.java:190-194 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java:50— processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java:50-54 | processing/src/main/java/org/apache/druid/query/filter/OrDimFilter.java:48-52 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java` and `processing/src/main/java/org/apache/druid/query/filter/OrDimFilter.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java:119— processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java:119-123 | processing/src/main/java/org/apache/druid/query/filter/OrDimFilter.java:124-128 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java` and `processing/src/main/java/org/apache/druid/query/filter/OrDimFilter.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
+ 19 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×42
Edited copy of a member (11 corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunner.java:541— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunner.java:541-551 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/SingleTaskBackgroundRunner.java:113-134 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/filtration/Bounds.java:109— sql/src/main/java/org/apache/druid/sql/calcite/filtration/Bounds.java:109-121 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/Ranges.java:122-132 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:272— processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:272-282 | processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:289-299 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:211— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:211-221 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamStartSequenceNumbers.java:230-241 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:425— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:425-435 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/DefaultBasicAuthorizerResourceHandler.java:233-244 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:505— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:505-521 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:527-537 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/DimensionCardinalityReport.java:87— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/DimensionCardinalityReport.java:87-97 | processing/src/main/java/org/apache/druid/indexer/report/IngestionStatsAndErrorsTaskReport.java:67-77 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:55— processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:55-68 | processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyVectorAggregator.java:158-168 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroStreamInputFormat.java:99— extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroStreamInputFormat.java:99-111 | extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufInputFormat.java:68-78 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/java/util/metrics/ProcFsReader.java:56— processing/src/main/java/org/apache/druid/java/util/metrics/ProcFsReader.java:56-66 | processing/src/main/java/org/apache/druid/java/util/metrics/ProcFsReader.java:75-85 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/input/stage/SparseStripedReadablePartitions.java:88— multi-stage-query/src/main/java/org/apache/druid/msq/input/stage/SparseStripedReadablePartitions.java:88-98 | multi-stage-query/src/main/java/org/apache/druid/msq/input/stage/StripedReadablePartitions.java:82-92 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/EqualDistributionWithCategorySpecWorkerSelectStrategy.java:80— indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/EqualDistributionWithCategorySpecWorkerSelectStrategy.java:80-90 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/FillCapacityWithCategorySpecWorkerSelectStrategy.java:81-91 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/EqualDistributionWorkerSelectStrategy.java:90— indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/EqualDistributionWorkerSelectStrategy.java:90-100 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/FillCapacityWorkerSelectStrategy.java:88-98 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:4130— processing/src/main/java/org/apache/druid/math/expr/Function.java:4130-4140 | processing/src/main/java/org/apache/druid/math/expr/Function.java:4274-4286 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/segment/transform/ExpressionTransform.java:134— processing/src/main/java/org/apache/druid/segment/transform/ExpressionTransform.java:134-144 | processing/src/main/java/org/apache/druid/segment/virtual/ExpressionVirtualColumn.java:390-401 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/query/extraction/LowerExtractionFn.java:86— processing/src/main/java/org/apache/druid/query/extraction/LowerExtractionFn.java:86-96 | processing/src/main/java/org/apache/druid/query/extraction/UpperExtractionFn.java:85-95 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainer.java:78— processing/src/main/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainer.java:78-88 | server/src/main/java/org/apache/druid/server/lookup/cache/LookupExtractorFactoryMapContainer.java:82-92 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/segment/ConstantDimensionSelector.java:75— processing/src/main/java/org/apache/druid/segment/ConstantDimensionSelector.java:75-85 | processing/src/main/java/org/apache/druid/segment/DimensionSelector.java:273-284 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/NullFilter.java:192— processing/src/main/java/org/apache/druid/query/filter/NullFilter.java:192-202 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/RangeRefKey.java:67-77 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:409— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:409-420 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:160-170 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:171— server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:171-181 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:238-249 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/common/OrderedPartitionableRecord.java:80— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/common/OrderedPartitionableRecord.java:80-90 | processing/src/main/java/org/apache/druid/audit/AuditEntry.java:54-64 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountPostAggregator.java:121— extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountPostAggregator.java:121-131 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramPostAggregator.java:72-82 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionIOConfig.java:82— indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionIOConfig.java:82-93 | server/src/main/java/org/apache/druid/client/indexing/ClientCompactionIOConfig.java:71-81 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) server/src/main/java/org/apache/druid/catalog/model/Columns.java:128— server/src/main/java/org/apache/druid/catalog/model/Columns.java:128-138 | server/src/main/java/org/apache/druid/catalog/model/facade/ExternalTableFacade.java:38-49 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 17 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×41
Edited copy of a member (14 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/filtration/MoveTimeFiltersToIntervals.java:173— sql/src/main/java/org/apache/druid/sql/calcite/filtration/MoveTimeFiltersToIntervals.java:173-186 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/MoveTimeFiltersToIntervals.java:189-202 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/guava/Comparators.java:84— processing/src/main/java/org/apache/druid/java/util/common/guava/Comparators.java:84-97 | processing/src/main/java/org/apache/druid/java/util/common/guava/Comparators.java:106-119 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:108— processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:108-129 | processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:114-127 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/TimeExtractionTopNAlgorithm.java:124— processing/src/main/java/org/apache/druid/query/topn/TimeExtractionTopNAlgorithm.java:124-140 | processing/src/main/java/org/apache/druid/query/topn/types/StringTopNColumnAggregatesProcessor.java:86-99 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/collections/spatial/search/PolygonBound.java:49— processing/src/main/java/org/apache/druid/collections/spatial/search/PolygonBound.java:49-63 | processing/src/main/java/org/apache/druid/collections/spatial/search/PolygonBound.java:66-79 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidJoinQueryRel.java:149— sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidJoinQueryRel.java:149-165 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidJoinQueryRel.java:168-181 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PushedSegmentsReport.java:96— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PushedSegmentsReport.java:96-109 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/MSQErrorReport.java:176-189 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRegistryBasedAvroBytesDecoder.java:190— extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRegistryBasedAvroBytesDecoder.java:190-203 | extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/SchemaRegistryBasedProtobufBytesDecoder.java:213-228 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/timeline/DataSegment.java:287— processing/src/main/java/org/apache/druid/timeline/DataSegment.java:287-300 | processing/src/main/java/org/apache/druid/timeline/DataSegment.java:742-757 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/output/AzureOutputConfig.java:152— extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/output/AzureOutputConfig.java:152-165 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleOutputConfig.java:122-135 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/rules/ExactProjectionPartialLoadMatcher.java:61— server/src/main/java/org/apache/druid/server/coordinator/rules/ExactProjectionPartialLoadMatcher.java:61-74 | server/src/main/java/org/apache/druid/server/coordinator/rules/WildcardProjectionPartialLoadMatcher.java:94-109 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:91— processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:91-104 | processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:94-110 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:514— extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:514-527 | processing/src/main/java/org/apache/druid/data/input/impl/FlatTextInputFormat.java:167-180 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorFactory.java:87— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorFactory.java:87-100 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchAggregatorFactory.java:87-100 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:195— processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:195-208 | processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java:200-213 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:683— processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:683-696 | processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:716-731 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/planner/CatalogDdlHandler.java:327— sql/src/main/java/org/apache/druid/sql/calcite/planner/CatalogDdlHandler.java:327-340 | sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:433-449 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:271— processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:271-287 | processing/src/main/java/org/apache/druid/query/filter/SelectorDimFilter.java:178-191 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/query/QueryContexts.java:973— processing/src/main/java/org/apache/druid/query/QueryContexts.java:973-990 | processing/src/main/java/org/apache/druid/query/QueryContexts.java:1001-1014 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:1030— multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:1030-1043 | multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:1064-1077 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) processing/src/main/java/org/apache/druid/segment/DictionaryMergingIterator.java:48— processing/src/main/java/org/apache/druid/segment/DictionaryMergingIterator.java:48-61 | processing/src/main/java/org/apache/druid/segment/SimpleDictionaryMergingIterator.java:38-51 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:390— server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:390-403 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:443-456 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java:97— indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java:97-110 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java:113-126 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:299— indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:299-312 | indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:318-335 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskIOConfig.java:111— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskIOConfig.java:111-124 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskIOConfig.java:243-258 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 16 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×41
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/utils/DynamicConfigProviderUtils.java:33— processing/src/main/java/org/apache/druid/utils/DynamicConfigProviderUtils.java:33-45 | processing/src/main/java/org/apache/druid/utils/DynamicConfigProviderUtils.java:48-60 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:2176— processing/src/main/java/org/apache/druid/math/expr/Function.java:2176-2188 | processing/src/main/java/org/apache/druid/math/expr/Function.java:2262-2274 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalDoubleVector.java:60— processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalDoubleVector.java:60-72 | processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalLongVector.java:55-67 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) server/src/main/java/org/apache/druid/client/DirectDruidClient.java:263— server/src/main/java/org/apache/druid/client/DirectDruidClient.java:263-276 | server/src/main/java/org/apache/druid/discovery/DataServerResponseHandler.java:240-252 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:63— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:63-75 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouper.java:77-91 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:216— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:216-228 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:271-283 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:271— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:271-283 | processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:456-469 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/LikeDimFilter.java:185— processing/src/main/java/org/apache/druid/query/filter/LikeDimFilter.java:185-198 | processing/src/main/java/org/apache/druid/query/filter/RegexDimFilter.java:150-162 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:105— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:105-117 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:125-137 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:391— processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:391-403 | processing/src/main/java/org/apache/druid/query/filter/IntervalDimFilter.java:153-165 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/query/planning/PreJoinableClause.java:112— processing/src/main/java/org/apache/druid/query/planning/PreJoinableClause.java:112-125 | processing/src/main/java/org/apache/druid/segment/join/JoinableClause.java:122-134 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) server/src/main/java/org/apache/druid/server/http/MetadataResource.java:318— server/src/main/java/org/apache/druid/server/http/MetadataResource.java:318-330 | server/src/main/java/org/apache/druid/server/http/ServersResource.java:149-162 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:299— sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:299-311 | sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:367-382 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:735— indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:735-747 | server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java:459-471 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerFailedFault.java:77— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerFailedFault.java:77-89 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerRpcFailedFault.java:75-87 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/query/Druids.java:151— processing/src/main/java/org/apache/druid/query/Druids.java:151-163 | processing/src/main/java/org/apache/druid/query/Druids.java:852-866 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java:425— processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java:425-437 | processing/src/main/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactory.java:365-377 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:488— indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:488-500 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:674-686 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:114— processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:114-126 | processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java:131-143 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/rules/PeriodLoadRule.java:90— server/src/main/java/org/apache/druid/server/coordinator/rules/PeriodLoadRule.java:90-102 | server/src/main/java/org/apache/druid/server/coordinator/rules/PeriodPartialLoadRule.java:85-97 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:62— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:62-74 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorFactory.java:116-130 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregatorHelper.java:113— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregatorHelper.java:113-128 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchBufferAggregatorHelper.java:111-123 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:322— processing/src/main/java/org/apache/druid/math/expr/Function.java:322-338 | processing/src/main/java/org/apache/druid/math/expr/Function.java:384-396 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountAggregatorFactory.java:173— extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountAggregatorFactory.java:173-185 | server/src/main/java/org/apache/druid/client/ImmutableDruidDataSource.java:191-210 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:232— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:232-244 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchMergeAggregatorFactory.java:171-186 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (12 lines × 2) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:86— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:86-97 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentMover.java:107-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthSSLConfig.java:169— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthSSLConfig.java:169-180 | extensions-core/simple-client-sslcontext/src/main/java/org/apache/druid/https/SSLClientConfig.java:126-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/BasicAuthenticatorResource.java:276— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/BasicAuthenticatorResource.java:276-287 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/BasicAuthorizerResource.java:691-702 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:993— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:993-1004 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:1034-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:110— extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:110-121 | extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:146-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java:62— extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java:62-73 | extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/ParquetExtensionsModule.java:67-78 — before extracting anything, compare `extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java` and `extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/ParquetExtensionsModule.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/CompactionSupervisorManager.java:78— indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/CompactionSupervisorManager.java:78-89 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:193-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/CompactionSupervisorManager.java:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spec` to `CompactionSupervisorSpec` in one and `SupervisorSpec` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2041— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2041-2052 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2073-2084 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:874— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:874-885 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1518-1529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerTableInputSpecSlicer.java:103— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerTableInputSpecSlicer.java:103-114 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerTableInputSpecSlicer.java:136-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:425— multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:425-436 | multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:681-692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:425` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/java/util/common/JodaUtils.java:188— processing/src/main/java/org/apache/druid/java/util/common/JodaUtils.java:188-199 | processing/src/main/java/org/apache/druid/java/util/common/JodaUtils.java:208-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/common/JodaUtils.java:188` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/math/expr/Parser.java:246— processing/src/main/java/org/apache/druid/math/expr/Parser.java:246-257 | processing/src/main/java/org/apache/druid/math/expr/Parser.java:302-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/Parser.java:246` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/query/ChainedExecutionQueryRunner.java:173— processing/src/main/java/org/apache/druid/query/ChainedExecutionQueryRunner.java:173-184 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByMergingQueryRunner.java:397-408 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/ChainedExecutionQueryRunner.java:173` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:121— processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:121-132 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:128-139 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java` and `processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:102— processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:102-113 | processing/src/main/java/org/apache/druid/segment/vector/ConcatenatingVectorCursor.java:109-120 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexIO.java:1129— processing/src/main/java/org/apache/druid/segment/IndexIO.java:1129-1140 | processing/src/main/java/org/apache/druid/segment/IndexIO.java:1184-1195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/IndexIO.java:1129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:382— processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:382-393 | processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:415-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:382` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:100— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:100-111 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:99-110 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarNestedCommonFormatColumnSerializer.java:200— processing/src/main/java/org/apache/druid/segment/nested/ScalarNestedCommonFormatColumnSerializer.java:200-211 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:326-337 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/ScalarNestedCommonFormatColumnSerializer.java:200` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/ScalarNestedCommonFormatColumnSerializer.java:199` calls `getCardinality` and `processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:325` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:319— processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:319-330 | processing/src/main/java/org/apache/druid/segment/projections/TableProjectionSchema.java:168-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) server/src/main/java/org/apache/druid/client/broker/BrokerClientImpl.java:120— server/src/main/java/org/apache/druid/client/broker/BrokerClientImpl.java:120-131 | server/src/main/java/org/apache/druid/client/broker/BrokerClientImpl.java:136-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `CoordinatorDynamicConfig` in one and `BrokerDynamicConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1607— server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1607-1618 | server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1659-1670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1607` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:392— server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:392-403 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:445-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:798— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:798-809 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:937-948 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
+ 16 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×40
Edited copy of a member (7 corresponding lines) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:105— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:105-113 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/Quantiles.java:92-98 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/SendAllGraphiteEventConverter.java:150— extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/SendAllGraphiteEventConverter.java:150-156 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:263-270 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskLocks.java:308— indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskLocks.java:308-314 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/KillUnusedSegmentsTask.java:437-447 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/counters/CpuCounters.java:52— multi-stage-query/src/main/java/org/apache/druid/msq/counters/CpuCounters.java:52-58 | processing/src/main/java/org/apache/druid/java/util/http/client/pool/ResourcePool.java:85-91 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/QueryInfoAndReport.java:68— multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/QueryInfoAndReport.java:68-76 | sql/src/main/java/org/apache/druid/sql/http/GetQueryReportResponse.java:60-66 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:67— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:67-73 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:71-78 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) processing/src/main/java/org/apache/druid/segment/generator/DataGenerator.java:95— processing/src/main/java/org/apache/druid/segment/generator/DataGenerator.java:95-101 | processing/src/main/java/org/apache/druid/segment/generator/DataGenerator.java:109-116 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) processing/src/main/java/org/apache/druid/segment/TimeAndDimsPointer.java:231— processing/src/main/java/org/apache/druid/segment/TimeAndDimsPointer.java:231-238 | processing/src/main/java/org/apache/druid/segment/TimeAndDimsPointer.java:241-247 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemServerPropertiesTable.java:180— sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemServerPropertiesTable.java:180-189 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1429-1435 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamStartSequenceNumbers.java:63— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamStartSequenceNumbers.java:63-75 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:66-72 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/counters/CounterSnapshotsSerializer.java:46— multi-stage-query/src/main/java/org/apache/druid/msq/counters/CounterSnapshotsSerializer.java:46-54 | processing/src/main/java/org/apache/druid/java/util/emitter/core/EventMapSerializer.java:33-39 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/TimestampFloorExprMacro.java:114— processing/src/main/java/org/apache/druid/query/expression/TimestampFloorExprMacro.java:114-121 | processing/src/main/java/org/apache/druid/query/expression/TimestampShiftExprMacro.java:101-107 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunnerResource.java:56— indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunnerResource.java:56-63 | server/src/main/java/org/apache/druid/client/HttpServerInventoryViewResource.java:54-60 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchOperations.java:98— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchOperations.java:98-104 | processing/src/main/java/org/apache/druid/collections/spatial/search/RadiusBound.java:93-99 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) server/src/main/java/org/apache/druid/guice/http/HttpClientModule.java:91— server/src/main/java/org/apache/druid/guice/http/HttpClientModule.java:91-97 | server/src/main/java/org/apache/druid/guice/http/JettyHttpClientModule.java:66-72 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) processing/src/main/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainer.java:59— processing/src/main/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainer.java:59-65 | server/src/main/java/org/apache/druid/server/lookup/cache/LookupExtractorFactoryMapContainer.java:63-69 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/AbstractBatchIndexTask.java:786— indexing-service/src/main/java/org/apache/druid/indexing/common/task/AbstractBatchIndexTask.java:786-792 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/CachingLocalSegmentAllocator.java:120-126 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/logical/stages/GroupByStages.java:114— multi-stage-query/src/main/java/org/apache/druid/msq/logical/stages/GroupByStages.java:114-120 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java:317-326 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/CaseInsensitiveContainsExprMacro.java:53— processing/src/main/java/org/apache/druid/query/expression/CaseInsensitiveContainsExprMacro.java:53-59 | processing/src/main/java/org/apache/druid/query/expression/ContainsExprMacro.java:52-58 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) server/src/main/java/org/apache/druid/server/ClientInfoResource.java:127— server/src/main/java/org/apache/druid/server/ClientInfoResource.java:127-133 | server/src/main/java/org/apache/druid/server/http/InventoryViewUtils.java:44-50 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) processing/src/main/java/org/apache/druid/query/operator/window/WindowFramedAggregateProcessor.java:84— processing/src/main/java/org/apache/druid/query/operator/window/WindowFramedAggregateProcessor.java:84-90 | processing/src/main/java/org/apache/druid/query/rowsandcols/semantic/FramedOnHeapAggregatable.java:42-48 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchUnionPostAggregator.java:105— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchUnionPostAggregator.java:105-111 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchSetPostAggregator.java:67-73 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchMultiPostAggregator.java:49— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchMultiPostAggregator.java:49-57 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchUnaryPostAggregator.java:57-63 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/BasicAuthenticatorResource.java:213— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/BasicAuthenticatorResource.java:213-219 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/BasicAuthorizerResource.java:233-240 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/LoadingLookupFactory.java:87— extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/LoadingLookupFactory.java:87-93 | extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookupFactory.java:101-109 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Unfinished stub — throws a "not implemented" exception extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:101— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:107— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildAggregator.java:54— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildAggregator.java:60— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildBufferAggregator.java:69— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildBufferAggregator.java:75— `getDouble` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildBufferAggregator.java:81— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeAggregator.java:52— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeAggregator.java:58— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeBufferAggregator.java:65— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeBufferAggregator.java:71— `getDouble` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeBufferAggregator.java:77— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchBuildAggregator.java:63— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchBuildAggregator.java:69— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchBuildBufferAggregator.java:82— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchBuildBufferAggregator.java:88— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMergeAggregator.java:59— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMergeAggregator.java:65— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMergeBufferAggregator.java:83— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMergeBufferAggregator.java:89— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMergeBufferAggregator.java:95— `getDouble` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchBufferAggregator.java:97— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchBufferAggregator.java:103— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregator.java:74— `getFloat` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregator.java:80— `getLong` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/workbench-view/workbench-view.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/workbench-view/query-tab/query-tab.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/explore-view.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/console-application.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/modules/time-chart-module/time-chart-module.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/components/control-pane/control-pane.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/components/resource-pane/resource-pane.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/workbench-view/input-source-step/input-source-step.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-single-render.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/components/module-pane/module-pane.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/sql-data-loader-view/schema-step/rollup-analysis-pane/rollup-analysis-pane.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/workbench-view/input-format-step/input-format-step.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/modules/grouping-table-module/grouping-table-module.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/workbench-view/demo-queries.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/explore-view/components/control-pane/measure-menu.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
+ 15 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×37
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:1281— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:1281-1289 | processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:1292-1300 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:2210— processing/src/main/java/org/apache/druid/math/expr/Function.java:2210-2218 | processing/src/main/java/org/apache/druid/math/expr/Function.java:2285-2293 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/rules/WildcardClusterGroupPartialLoadMatcher.java:83— server/src/main/java/org/apache/druid/server/coordinator/rules/WildcardClusterGroupPartialLoadMatcher.java:83-94 | server/src/main/java/org/apache/druid/server/coordinator/rules/WildcardProjectionPartialLoadMatcher.java:69-77 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/rules/ClusterGroupPartialLoadMatcher.java:97— server/src/main/java/org/apache/druid/server/coordinator/rules/ClusterGroupPartialLoadMatcher.java:97-105 | server/src/main/java/org/apache/druid/server/coordinator/rules/ProjectionPartialLoadMatcher.java:84-93 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/SegmentLock.java:61— indexing-service/src/main/java/org/apache/druid/indexing/common/SegmentLock.java:61-70 | indexing-service/src/main/java/org/apache/druid/indexing/common/TimeChunkLock.java:55-63 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:238— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:238-246 | server/src/main/java/org/apache/druid/server/http/CoordinatorResource.java:69-77 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:3670— processing/src/main/java/org/apache/druid/math/expr/Function.java:3670-3678 | processing/src/main/java/org/apache/druid/math/expr/Function.java:3698-3706 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java:258— processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java:258-268 | processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java:204-212 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/segment/projections/MergingColumnSelectorFactory.java:270— processing/src/main/java/org/apache/druid/segment/projections/MergingColumnSelectorFactory.java:270-278 | processing/src/main/java/org/apache/druid/segment/projections/MergingColumnSelectorFactory.java:282-290 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) server/src/main/java/org/apache/druid/metadata/SQLInputSourceDatabaseConnector.java:59— server/src/main/java/org/apache/druid/metadata/SQLInputSourceDatabaseConnector.java:59-67 | server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:203-212 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/ByteBufferCompressedBigDecimal.java:78— extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/ByteBufferCompressedBigDecimal.java:78-86 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/ByteBufferCompressedBigDecimal.java:89-97 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregator.java:51— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregator.java:51-63 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregator.java:58-66 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorCollector.java:241— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorCollector.java:241-250 | processing/src/main/java/org/apache/druid/query/extraction/BucketExtractionFn.java:144-152 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:195— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:195-203 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:195-203 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/frame/write/FrameWriterUtils.java:358— processing/src/main/java/org/apache/druid/frame/write/FrameWriterUtils.java:358-366 | sql/src/main/java/org/apache/druid/sql/calcite/table/DatasourceTable.java:179-189 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:379— processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:379-387 | processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:373-382 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:246— processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:246-254 | processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarIntsSupplier.java:222-232 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/HeapMemoryTaskStorage.java:143— indexing-service/src/main/java/org/apache/druid/indexing/overlord/HeapMemoryTaskStorage.java:143-151 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/HeapMemoryTaskStorage.java:178-188 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidNodeDiscoveryProvider.java:261— server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidNodeDiscoveryProvider.java:261-272 | server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidNodeDiscoveryProvider.java:276-284 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/RegexpLikeExprMacro.java:95— processing/src/main/java/org/apache/druid/query/expression/RegexpLikeExprMacro.java:95-103 | processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java:68-78 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunner.java:529— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunner.java:529-537 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/BaseRestorableTaskRunner.java:166-174 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/CompactionSupervisorManager.java:195— indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/CompactionSupervisorManager.java:195-205 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:733-741 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/client/GrpcResponseHandler.java:87— extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/client/GrpcResponseHandler.java:87-95 | extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/server/ProtobufWriter.java:56-64 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:412— processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:412-425 | processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:817-825 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:610— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:610-618 | server/src/main/java/org/apache/druid/server/compaction/CompactionSlotManager.java:310-318 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 12 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×37
Edited copy of a member (8 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentArchiver.java:94— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentArchiver.java:94-101 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentArchiver.java:94-101 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/sql/DartQueryMaker.java:144— multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/sql/DartQueryMaker.java:144-151 | multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java:364-371 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathProcessors.java:481— processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathProcessors.java:481-488 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathProcessors.java:516-523 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:117— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:117-124 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3ExportStorageProvider.java:172-179 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/segment/FilteredSegment.java:44— processing/src/main/java/org/apache/druid/segment/FilteredSegment.java:44-51 | processing/src/main/java/org/apache/druid/segment/UnnestSegment.java:47-54 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/segment/incremental/OnHeapClusteredBaseTable.java:350— processing/src/main/java/org/apache/druid/segment/incremental/OnHeapClusteredBaseTable.java:350-357 | processing/src/main/java/org/apache/druid/segment/incremental/OnHeapClusteredBaseTable.java:444-454 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:146— processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:146-153 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:166-175 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/filtration/BottomUpTransform.java:47— sql/src/main/java/org/apache/druid/sql/calcite/filtration/BottomUpTransform.java:47-54 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/RemoveRedundantIsTrue.java:47-54 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesAndWorkerTaskRunner.java:274— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesAndWorkerTaskRunner.java:274-281 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesAndWorkerTaskRunner.java:291-298 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaBufferAggregator.java:47— processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaBufferAggregator.java:47-56 | processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregator.java:42-49 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) server/src/main/java/org/apache/druid/catalog/model/ClusteredValueGroupsBaseTableMetadata.java:174— server/src/main/java/org/apache/druid/catalog/model/ClusteredValueGroupsBaseTableMetadata.java:174-182 | server/src/main/java/org/apache/druid/catalog/model/TableBaseTableMetadata.java:141-148 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingMultiValueGroupByColumnSelectorStrategy.java:129— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingMultiValueGroupByColumnSelectorStrategy.java:129-140 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingGroupByColumnSelectorStrategy.java:114-121 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) REDACTED:375— REDACTED:375-382 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:586-593 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:731— processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:731-743 | processing/src/main/java/org/apache/druid/segment/data/ObjectStrategy.java:84-91 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/error/BaseFailure.java:52— processing/src/main/java/org/apache/druid/error/BaseFailure.java:52-59 | processing/src/main/java/org/apache/druid/error/NotYetImplemented.java:57-66 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/input/stage/ReadablePartition.java:53— multi-stage-query/src/main/java/org/apache/druid/msq/input/stage/ReadablePartition.java:53-60 | multi-stage-query/src/main/java/org/apache/druid/msq/input/stage/ReadablePartitions.java:80-87 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) cloud/aws-common/src/main/java/org/apache/druid/common/aws/AWSClientConfig.java:93— cloud/aws-common/src/main/java/org/apache/druid/common/aws/AWSClientConfig.java:93-100 | processing/src/main/java/org/apache/druid/query/JoinAlgorithm.java:54-62 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/TimestampFloorExprMacro.java:138— processing/src/main/java/org/apache/druid/query/expression/TimestampFloorExprMacro.java:138-145 | processing/src/main/java/org/apache/druid/query/expression/TimestampShiftExprMacro.java:117-124 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) services/src/main/java/org/apache/druid/cli/CliCoordinator.java:429— services/src/main/java/org/apache/druid/cli/CliCoordinator.java:429-436 | services/src/main/java/org/apache/druid/cli/CliOverlord.java:429-436 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java:155— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java:155-168 | server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:408-415 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) server/src/main/java/org/apache/druid/metadata/SQLInputSourceDatabaseConnector.java:49— server/src/main/java/org/apache/druid/metadata/SQLInputSourceDatabaseConnector.java:49-56 | server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:163-177 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/MultipleFileTaskReportFileWriter.java:47— indexing-service/src/main/java/org/apache/druid/indexing/common/MultipleFileTaskReportFileWriter.java:47-54 | processing/src/main/java/org/apache/druid/indexer/report/SingleFileTaskReportFileWriter.java:45-52 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) processing/src/main/java/org/apache/druid/data/input/ListBasedInputRowAdapter.java:51— processing/src/main/java/org/apache/druid/data/input/ListBasedInputRowAdapter.java:51-59 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:399-406 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:198— sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:198-205 | sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java:760-767 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/DartDataServerQueryHandler.java:73— multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/DartDataServerQueryHandler.java:73-80 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerDataServerQueryHandler.java:121-130 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 12 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×33
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:152— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:152-168 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:122-140 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/collections/spatial/search/PolygonBound.java:181— processing/src/main/java/org/apache/druid/collections/spatial/search/PolygonBound.java:181-198 | processing/src/main/java/org/apache/druid/collections/spatial/search/RectangularBound.java:155-171 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentAnalysis.java:172— processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentAnalysis.java:172-190 | processing/src/main/java/org/apache/druid/segment/Metadata.java:311-327 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/balancer/SegmentsCostCache.java:260— server/src/main/java/org/apache/druid/server/coordinator/balancer/SegmentsCostCache.java:260-276 | server/src/main/java/org/apache/druid/server/coordinator/balancer/SegmentsCostCache.java:279-295 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1334— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1334-1352 | processing/src/main/java/org/apache/druid/query/aggregation/Histogram.java:197-213 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/frame/write/RowBasedFrameWriterFactory.java:117— processing/src/main/java/org/apache/druid/frame/write/RowBasedFrameWriterFactory.java:117-133 | processing/src/main/java/org/apache/druid/frame/write/columnar/ColumnarFrameWriterFactory.java:80-106 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorBasicAuthenticatorCacheNotifier.java:102— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorBasicAuthenticatorCacheNotifier.java:102-119 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorBasicAuthorizerCacheNotifier.java:120-136 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:76— processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:76-92 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:178-194 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentKiller.java:121— extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentKiller.java:121-137 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentKiller.java:58-79 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactory.java:79— processing/src/main/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactory.java:79-95 | processing/src/main/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactory.java:99-117 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:290— sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:290-307 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchemaProvider.java:78-94 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:375— extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:375-398 | extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeDiscoveryProvider.java:330-346 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Expr.java:827— processing/src/main/java/org/apache/druid/math/expr/Expr.java:827-843 | processing/src/main/java/org/apache/druid/math/expr/Expr.java:850-866 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) server/src/main/java/org/apache/druid/rpc/indexing/SpecificTaskServiceLocator.java:120— server/src/main/java/org/apache/druid/rpc/indexing/SpecificTaskServiceLocator.java:120-137 | server/src/main/java/org/apache/druid/rpc/indexing/SpecificTaskServiceLocator.java:248-264 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/MultiValueStringHllSketchBuildVectorProcessor.java:72— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/MultiValueStringHllSketchBuildVectorProcessor.java:72-92 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/ObjectHllSketchBuildVectorProcessor.java:70-86 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2040— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2040-2060 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2072-2088 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:422— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:422-438 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:366-382 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:213— processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:213-229 | processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:257-278 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/ServerHolder.java:515— server/src/main/java/org/apache/druid/server/coordinator/ServerHolder.java:515-534 | server/src/main/java/org/apache/druid/server/coordinator/ServerHolder.java:537-553 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/ProcCgroupDiscoverer.java:101— processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/ProcCgroupDiscoverer.java:101-119 | processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/ProcCgroupDiscoverer.java:122-138 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/query/datasourcemetadata/DataSourceQueryQueryToolChest.java:80— processing/src/main/java/org/apache/druid/query/datasourcemetadata/DataSourceQueryQueryToolChest.java:80-96 | processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java:103-119 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleStorageConnector.java:95— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleStorageConnector.java:95-111 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3StorageConnector.java:197-213 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:444— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:444-461 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:578-594 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureInputSource.java:141— extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureInputSource.java:141-157 | extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureStorageAccountInputSource.java:158-174 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:362— processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:362-378 | processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSetUtils.java:228-244 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 8 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×33
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/rowsandcols/MapOfColumnsRowsAndColumns.java:92— processing/src/main/java/org/apache/druid/query/rowsandcols/MapOfColumnsRowsAndColumns.java:92-107 | processing/src/main/java/org/apache/druid/query/rowsandcols/MapOfColumnsRowsAndColumns.java:110-128 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/TimestampExtractExprMacro.java:181— processing/src/main/java/org/apache/druid/query/expression/TimestampExtractExprMacro.java:181-196 | processing/src/main/java/org/apache/druid/query/expression/TimestampExtractExprMacro.java:245-261 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:505— processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:505-531 | processing/src/main/java/org/apache/druid/segment/file/SegmentFileMapperV10.java:174-189 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/http/ClientSqlQuery.java:117— processing/src/main/java/org/apache/druid/query/http/ClientSqlQuery.java:117-132 | sql/src/main/java/org/apache/druid/sql/http/SqlQuery.java:160-175 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:326— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:326-341 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:659-674 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:345— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:345-360 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:678-693 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:364— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:364-379 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:697-712 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:639— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:639-655 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:629-644 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/DruidExceptionFault.java:116— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/DruidExceptionFault.java:116-131 | processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQuery.java:301-317 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/rowsandcols/ArrayListRowsAndColumns.java:481— processing/src/main/java/org/apache/druid/query/rowsandcols/ArrayListRowsAndColumns.java:481-496 | processing/src/main/java/org/apache/druid/query/rowsandcols/semantic/DefaultClusteredGroupPartitioner.java:83-98 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/dimension/ForwardingFilteredDimensionSelector.java:144— processing/src/main/java/org/apache/druid/query/dimension/ForwardingFilteredDimensionSelector.java:144-164 | processing/src/main/java/org/apache/druid/query/dimension/PredicateFilteredDimensionSelector.java:110-125 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeCoalesceRule.java:56— sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeCoalesceRule.java:56-71 | sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRule.java:58-74 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyAttemptsForJob.java:102— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyAttemptsForJob.java:102-120 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyAttemptsForWorker.java:101-116 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:277— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:277-292 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java:300-316 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:1160— processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:1160-1175 | processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:1279-1295 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java:43— processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java:43-59 | processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanBufferAggregator.java:51-66 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java:105— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java:105-120 | extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:230-248 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/extendedset/intset/AbstractIntSet.java:66— processing/src/main/java/org/apache/druid/extendedset/intset/AbstractIntSet.java:66-82 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:888-903 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:257— processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:257-272 | processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:253-269 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleStorageConnector.java:62— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleStorageConnector.java:62-79 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3StorageConnector.java:70-85 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java:127— processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java:127-142 | processing/src/main/java/org/apache/druid/query/filter/OrDimFilter.java:132-147 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/IsBooleanDimFilter.java:92— processing/src/main/java/org/apache/druid/query/filter/IsBooleanDimFilter.java:92-107 | processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java:123-138 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidNodeAnnouncer.java:64— server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidNodeAnnouncer.java:64-79 | server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidNodeAnnouncer.java:83-98 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/filtration/BoundRefKey.java:77— sql/src/main/java/org/apache/druid/sql/calcite/filtration/BoundRefKey.java:77-94 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/BoundValue.java:50-65 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java:245— server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java:245-261 | server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java:264-279 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureInputSource.java:114— extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureInputSource.java:114-126 | extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureStorageAccountInputSource.java:127-139 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java:172— extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java:172-184 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentPusher.java:165-177 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java:172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java:154— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java:154-166 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchMergeAggregatorFactory.java:204-216 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java:154` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:102— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:102-114 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3ExportStorageProvider.java:157-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:102` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskTuningConfig.java:341— extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskTuningConfig.java:341-353 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:255-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:636— processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:636-648 | processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:683-695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/math/expr/Parser.java:409— processing/src/main/java/org/apache/druid/math/expr/Parser.java:409-421 | processing/src/main/java/org/apache/druid/math/expr/Parser.java:475-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/math/expr/Parser.java:471` calls `add`, `IdentifierExpr` and `processing/src/main/java/org/apache/druid/math/expr/Parser.java:405` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/FallbackVectorProcessor.java:279— processing/src/main/java/org/apache/druid/math/expr/vector/FallbackVectorProcessor.java:279-291 | processing/src/main/java/org/apache/druid/math/expr/vector/FallbackVectorProcessor.java:330-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/FallbackVectorProcessor.java:279` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/query/JoinDataSource.java:575— processing/src/main/java/org/apache/druid/query/JoinDataSource.java:575-587 | processing/src/main/java/org/apache/druid/query/planning/JoinDataSourceAnalysis.java:170-182 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/JoinDataSource.java:575` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:57— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:57-69 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:56-68 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesBufferAggregator.java:76— processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesBufferAggregator.java:76-88 | processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesVectorAggregator.java:90-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesBufferAggregator.java:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMeanVectorAggregator.java:99— processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMeanVectorAggregator.java:99-111 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleSumVectorAggregator.java:54-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:150— processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:150-162 | processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:225-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:150` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:73— processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:73-85 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:109-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:72— processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:72-84 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:108-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:379— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:379-391 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:488-500 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSerializer.java:63— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSerializer.java:63-75 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSerializer.java:64-76 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSerializer.java` and `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSerializer.java` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:233— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:233-245 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:288-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:299— processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:299-311 | processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:328-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:254— server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:254-266 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:271-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) server/src/main/java/org/apache/druid/server/ClientInfoResource.java:233— server/src/main/java/org/apache/druid/server/ClientInfoResource.java:233-245 | server/src/main/java/org/apache/druid/server/ClientInfoResource.java:263-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/ClientInfoResource.java:233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) server/src/main/java/org/apache/druid/server/http/CoordinatorBrokerConfigsResource.java:100— server/src/main/java/org/apache/druid/server/http/CoordinatorBrokerConfigsResource.java:100-112 | server/src/main/java/org/apache/druid/server/http/CoordinatorDynamicConfigsResource.java:98-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/http/CoordinatorBrokerConfigsResource.java:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:93— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:93-105 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayOverlapOperatorConversion.java:93-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:388— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:388-400 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:519-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:388` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:429— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:429-441 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:562-575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:429` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchSingleArgBaseOperatorConversion.java:72— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchSingleArgBaseOperatorConversion.java:72-87 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchEstimateWithErrorBoundsOperatorConversion.java:80-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:101— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:101-116 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:109-124 — before extracting anything, compare `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java` and `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:708— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:708-723 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:726-741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesOverlordModule.java:309— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesOverlordModule.java:309-324 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/MultipleKubernetesTaskRunnerFactory.java:352-367 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesOverlordModule.java:309` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:503— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:503-518 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:389-404 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:406` calls `exists`, `writeValue` and `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:520` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:780— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:780-795 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:807-822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:780` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:49— processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:49-64 | processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java:66-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:81— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:81-96 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:71-86 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:81` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:112— processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:112-127 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:191-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:112` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:428— processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:428-443 | processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:422-437 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:428` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:438` calls `visit` and `processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:445` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:160— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:160-175 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java:152-167 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java` and `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:210— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:210-225 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:152-167 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:246— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:246-261 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:178-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:376— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:376-391 | processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:446-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:719— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:719-734 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1017-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:719` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:766— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:766-781 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1063-1078 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:766` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:902— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:902-917 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:526-541 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:525` calls `get` and `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:901` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) processing/src/main/java/org/apache/druid/segment/writeout/FileWriteOutBytes.java:107— processing/src/main/java/org/apache/druid/segment/writeout/FileWriteOutBytes.java:107-122 | processing/src/main/java/org/apache/druid/segment/writeout/LegacyFileWriteOutBytes.java:93-108 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/writeout/FileWriteOutBytes.java` and `processing/src/main/java/org/apache/druid/segment/writeout/LegacyFileWriteOutBytes.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:220— server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:220-235 | server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:315-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:220` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:416— server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:416-431 | server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java:465-480 — before extracting anything, compare `server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java` and `server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:416` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) server/src/main/java/org/apache/druid/rpc/ServiceClientImpl.java:144— server/src/main/java/org/apache/druid/rpc/ServiceClientImpl.java:144-159 | server/src/main/java/org/apache/druid/rpc/ServiceClientImpl.java:342-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/rpc/ServiceClientImpl.java:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:717— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:717-732 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:833-848 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:717` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) server/src/main/java/org/apache/druid/server/initialization/AuthenticatorMapperModule.java:115— server/src/main/java/org/apache/druid/server/initialization/AuthenticatorMapperModule.java:115-130 | server/src/main/java/org/apache/druid/server/initialization/AuthorizerMapperModule.java:146-161 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:116— sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:116-131 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArraySqlAggregator.java:126-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:116` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/CeilOperatorConversion.java:52— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/CeilOperatorConversion.java:52-67 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/FloorOperatorConversion.java:52-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
+ 5 more in this group — see findings.md.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×30
Length read from the parsed input is spent without ever being bounded server/src/main/java/org/apache/druid/client/cache/CaffeineCache.java:186— `decompressedLen` is read from the bytes being parsed at line 185 (`getInt`), then used to size a `new byte[]` at line 186 — and nowhere in its scope is `decompressedLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `decompressedLen` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded server/src/main/java/org/apache/druid/client/cache/LZ4Transcoder.java:73— `size` is read from the bytes being parsed at line 71 (`getInt`), then used to size a `new byte[]` at line 73 — and nowhere in its scope is `size` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:551— `keyLength` is read from the bytes being parsed at line 550 (`getInt`), then used to size a `new byte[]` at line 551 — and nowhere in its scope is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/utils/CompressionUtils.java:374— `fileNameLength` is read from the bytes being parsed at line 373 (`readInt`), then used to size a `new byte[]` at line 374 — and nowhere in its scope is `fileNameLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `fileNameLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/segment/file/SegmentFileMetadataReader.java:120— `metaLength` is read from the bytes being parsed at line 119 (`getInt`), then used to size a `new byte[]` at line 120 — and nowhere in its scope is `metaLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `metaLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/segment/file/SegmentFileMetadataReader.java:139— `compressedLength` is read from the bytes being parsed at line 136 (`getInt`), then used to size a `new byte[]` at line 139 — and nowhere in its scope is `compressedLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `compressedLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:492— `length` is read from the bytes being parsed at line 491 (`getInt`), then used to size a `new byte[]` at line 492 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:588— `arrayLength` is read from the bytes being parsed at line 587 (`getInt`), then used to size a `new Object[]` at line 588 — and nowhere in its scope is `arrayLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `arrayLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/query/aggregation/Histogram.java:199— `n` is read from the bytes being parsed at line 198 (`getInt`), then used to size a `new float[]` at line 199 — and nowhere in its scope is `n` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `n` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:242— `stringSize` is read from the bytes being parsed at line 238 (`getInt`), then used to size a `new byte[]` at line 242 — and nowhere in its scope is `stringSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSize` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:125— `stringSize` is read from the bytes being parsed at line 121 (`getInt`), then used to size a `new byte[]` at line 125 — and nowhere in its scope is `stringSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSize` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:106— `stringSize` is read from the bytes being parsed at line 102 (`getInt`), then used to size a `new byte[]` at line 106 — and nowhere in its scope is `stringSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSize` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/query/aggregation/firstlast/StringFirstLastUtils.java:129— `stringSizeBytes` is read from the bytes being parsed at line 125 (`getInt`), then used to size a `new byte[]` at line 129 — and nowhere in its scope is `stringSizeBytes` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSizeBytes` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:98— `stringSizeBytes` is read from the bytes being parsed at line 96 (`getInt`), then used to size a `new byte[]` at line 98 — and nowhere in its scope is `stringSizeBytes` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSizeBytes` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyVectorAggregator.java:143— `stringSizeBytes` is read from the bytes being parsed at line 141 (`getInt`), then used to size a `new byte[]` at line 143 — and nowhere in its scope is `stringSizeBytes` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `stringSizeBytes` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/frame/wire/FrameWireTransferable.java:122— `signatureLen` is read from the bytes being parsed at line 121 (`getInt`), then used to size a `new byte[]` at line 122 — and nowhere in its scope is `signatureLen` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `signatureLen` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/crypto/CryptoService.java:212— `saltSize` is read from the bytes being parsed at line 208 (`getInt`), then used to size a `new byte[]` at line 212 — and nowhere in its scope is `saltSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `saltSize` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/crypto/CryptoService.java:215— `ivSize` is read from the bytes being parsed at line 209 (`getInt`), then used to size a `new byte[]` at line 215 — and nowhere in its scope is `ivSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `ivSize` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/crypto/CryptoService.java:218— `cipherSize` is read from the bytes being parsed at line 210 (`getInt`), then used to size a `new byte[]` at line 218 — and nowhere in its scope is `cipherSize` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `cipherSize` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded processing/src/main/java/org/apache/druid/common/utils/SerializerUtils.java:88— `length` is read from the bytes being parsed at line 86 (`getInt`), then used to size a `new String[]` at line 88 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded multi-stage-query/src/main/java/org/apache/druid/msq/statistics/serde/ClusterByStatisticsSnapshotSerde.java:169— `keyLength` is read from the bytes being parsed at line 161 (`getInt`), then used to size a `new byte[]` at line 169 — and nowhere in its scope is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded multi-stage-query/src/main/java/org/apache/druid/msq/statistics/serde/KeyCollectorSnapshotDeserializer.java:77— `length` is read from the bytes being parsed at line 71 (`getInt`), then used to size a `new byte[]` at line 77 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded multi-stage-query/src/main/java/org/apache/druid/msq/statistics/serde/KeyCollectorSnapshotDeserializer.java:114— `keyLength` is read from the bytes being parsed at line 108 (`getInt`), then used to size a `new byte[]` at line 114 — and nowhere in its scope is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded multi-stage-query/src/main/java/org/apache/druid/msq/statistics/serde/KeyCollectorSnapshotDeserializer.java:135— `sketchLength` is read from the bytes being parsed at line 134 (`getInt`), then used to size a `new byte[]` at line 135 — and nowhere in its scope is `sketchLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `sketchLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1312— `size` is read from the bytes being parsed at line 1309 (`getInt`), then used to size a `new float[]` at line 1312 — and nowhere in its scope is `size` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating.
+ 5 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×28
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:173— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:173-187 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:181-196 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java:59— indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java:59-73 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java:80-94 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:440— processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:440-454 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:686-702 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:3824— processing/src/main/java/org/apache/druid/math/expr/Function.java:3824-3842 | processing/src/main/java/org/apache/druid/math/expr/Function.java:3897-3911 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapTypeMapVirtualColumnDimensionSelector.java:119— extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapTypeMapVirtualColumnDimensionSelector.java:119-136 | extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java:181-195 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/query/dimension/ForwardingFilteredDimensionSelector.java:68— processing/src/main/java/org/apache/druid/query/dimension/ForwardingFilteredDimensionSelector.java:68-82 | processing/src/main/java/org/apache/druid/query/dimension/PredicateFilteredDimensionSelector.java:50-64 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:165— processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:165-180 | processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:163-177 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:2012— processing/src/main/java/org/apache/druid/math/expr/Function.java:2012-2026 | processing/src/main/java/org/apache/druid/math/expr/Function.java:2030-2046 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:100— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:100-114 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3ExportStorageProvider.java:155-169 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:279— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:279-293 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:279-293 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/CoordinatorBasicAuthenticatorResourceHandler.java:52— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/CoordinatorBasicAuthenticatorResourceHandler.java:52-67 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/DefaultBasicAuthenticatorResourceHandler.java:50-64 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:67— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:67-82 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/DefaultBasicAuthorizerResourceHandler.java:52-66 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/collections/spatial/ImmutableFloatNode.java:63— processing/src/main/java/org/apache/druid/collections/spatial/ImmutableFloatNode.java:63-78 | processing/src/main/java/org/apache/druid/collections/spatial/ImmutableFloatNode.java:89-103 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamDataSourceMetadata.java:85— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamDataSourceMetadata.java:85-99 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamDataSourceMetadata.java:103-117 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingAggregatorFactory.java:63— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingAggregatorFactory.java:63-82 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingAggregatorFactory.java:86-100 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/CountAggregatorFactory.java:164— processing/src/main/java/org/apache/druid/query/aggregation/CountAggregatorFactory.java:164-179 | processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniqueFinalizingPostAggregator.java:130-144 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:234— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:234-248 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/StringFirstLastUtils.java:120-135 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitter.java:257— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitter.java:257-271 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitter.java:225-239 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/DescriptorBasedProtobufBytesDecoder.java:181— extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/DescriptorBasedProtobufBytesDecoder.java:181-195 | extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/DescriptorBasedProtobufBytesDecoder.java:199-215 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingGroupByColumnSelectorStrategy.java:125— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingGroupByColumnSelectorStrategy.java:125-139 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingGroupByColumnSelectorStrategy.java:176-192 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) server/src/main/java/org/apache/druid/catalog/model/table/FormattedInputSourceDefn.java:126— server/src/main/java/org/apache/druid/catalog/model/table/FormattedInputSourceDefn.java:126-140 | server/src/main/java/org/apache/druid/catalog/model/table/FormattedInputSourceDefn.java:144-158 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/frame/channel/BlockingQueueFrameChannel.java:144— processing/src/main/java/org/apache/druid/frame/channel/BlockingQueueFrameChannel.java:144-158 | processing/src/main/java/org/apache/druid/frame/channel/BlockingQueueFrameChannel.java:178-193 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:695— server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:695-709 | server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1927-1941 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) server/src/main/java/org/apache/druid/metadata/SQLMetadataRuleManager.java:385— server/src/main/java/org/apache/druid/metadata/SQLMetadataRuleManager.java:385-409 | server/src/main/java/org/apache/druid/server/audit/SQLAuditManager.java:239-253 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:194— processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:194-208 | processing/src/main/java/org/apache/druid/java/util/common/parsers/ParserUtils.java:95-110 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (15 lines × 2) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:124— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:124-138 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java:132-146 — before extracting anything, compare `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java` and `extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitter.java:122— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitter.java:122-136 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitter.java:114-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitter.java:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java:52— extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java:52-66 | extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java:61-75 — before extracting anything, compare `extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java` and `extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java:76` calls `bind`, `annotatedWith`, `toInstance` and `extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java:67` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergInputSource.java:462— extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergInputSource.java:462-476 | multi-stage-query/src/main/java/org/apache/druid/msq/input/NilInputSource.java:80-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:123— extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:123-137 | extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:147-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregatorFactory.java:365— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregatorFactory.java:365-379 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingAggregatorFactory.java:176-190 — before extracting anything, compare `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregatorFactory.java` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingAggregatorFactory.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaDataSourceMetadata.java:145— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaDataSourceMetadata.java:145-159 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaDataSourceMetadata.java:165-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaDataSourceMetadata.java:145` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1876— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1876-1890 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1895-1909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1876` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1950— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1950-1964 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1969-1983 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1950` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/frame/processor/ComposingOutputChannelFactory.java:71— processing/src/main/java/org/apache/druid/frame/processor/ComposingOutputChannelFactory.java:71-85 | processing/src/main/java/org/apache/druid/frame/processor/ComposingOutputChannelFactory.java:120-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/processor/ComposingOutputChannelFactory.java:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/java/util/common/parsers/TimestampParser.java:150— processing/src/main/java/org/apache/druid/java/util/common/parsers/TimestampParser.java:150-164 | processing/src/main/java/org/apache/druid/query/expression/TimestampParseExprMacro.java:111-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java:239— processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java:239-253 | processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java:207-221 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:105— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:105-119 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java:109-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:151— processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:151-165 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:148-162 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java` and `processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:61— processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:61-75 | processing/src/main/java/org/apache/druid/segment/vector/ConcatenatingVectorCursor.java:67-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:98— processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:98-112 | processing/src/main/java/org/apache/druid/segment/FloatColumnSerializerV2.java:98-112 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java` and `processing/src/main/java/org/apache/druid/segment/FloatColumnSerializerV2.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:98` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:86— processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:86-100 | processing/src/main/java/org/apache/druid/segment/serde/ComplexMetrics.java:57-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:86` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/serde/ComplexMetrics.java:56` calls `registerComplex`, `getTypeStrategy` and `processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:85` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:736— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:736-750 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1034-1048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:736` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:740— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:740-754 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:729-743 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:740` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:756` calls `visit` and `processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:745` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:390— server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:390-404 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:83-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:342— server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:342-356 | server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java:390-404 — before extracting anything, compare `server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java` and `server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:456— server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:456-470 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:503-517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:456` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:353— sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:353-367 | sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:504-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:353` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:223— indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:223-237 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/SimpleWorkerProvisioningStrategy.java:168-182 — before extracting anything, compare `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java` and `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/SimpleWorkerProvisioningStrategy.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:223` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:153— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:153-167 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:123-137 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java:88— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java:88-101 | extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:191-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java:88` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 2) extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/HiveIcebergCatalog.java:115— extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/HiveIcebergCatalog.java:115-128 | extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageAuthentication.java:61-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/HiveIcebergCatalog.java:115` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:96— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:96-109 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:111-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:111` calls `initializeSketchIfNeeded` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:126` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:220— indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:220-233 | indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolboxFactory.java:205-218 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:220` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:219` calls `setObjectMapper` and `indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolboxFactory.java:204` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentMetadataUpdateAction.java:84— indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentMetadataUpdateAction.java:84-97 | indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentNukeAction.java:97-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentMetadataUpdateAction.java:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1384— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1384-1397 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTuningConfig.java:191-204 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernelUtils.java:261— multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernelUtils.java:261-274 | multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernelUtils.java:282-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/DurableStorageQueryResultsOutputChannelFactory.java:90— multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/DurableStorageQueryResultsOutputChannelFactory.java:90-104 | multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/DurableStorageTaskOutputChannelFactory.java:107-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/DurableStorageQueryResultsOutputChannelFactory.java:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:49— processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:49-62 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:92-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:68— processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:68-81 | processing/src/main/java/org/apache/druid/java/util/emitter/core/SwitchingEmitter.java:126-139 — before extracting anything, compare `processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java` and `processing/src/main/java/org/apache/druid/java/util/emitter/core/SwitchingEmitter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:68` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:91— processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:91-104 | processing/src/main/java/org/apache/druid/java/util/emitter/core/SwitchingEmitter.java:153-166 — before extracting anything, compare `processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java` and `processing/src/main/java/org/apache/druid/java/util/emitter/core/SwitchingEmitter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:91` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/math/expr/Parser.java:231— processing/src/main/java/org/apache/druid/math/expr/Parser.java:231-244 | processing/src/main/java/org/apache/druid/math/expr/Parser.java:287-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/Parser.java:231` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/math/expr/Parser.java:392— processing/src/main/java/org/apache/druid/math/expr/Parser.java:392-405 | processing/src/main/java/org/apache/druid/math/expr/Parser.java:456-469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java:40— processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java:40-53 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateProcessorFactory.java:40-53 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateProcessorFactory.java` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:121— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:121-134 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:102-115 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:121` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:142— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:142-155 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregatorFactory.java:107-120 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstBufferAggregator.java:78— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstBufferAggregator.java:78-91 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastBufferAggregator.java:78-91 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstBufferAggregator.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastBufferAggregator.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstBufferAggregator.java:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:91— processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:91-104 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:122-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouper.java:296— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouper.java:296-309 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouper.java:335-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouper.java:296` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:302— processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:302-315 | processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:331-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/segment/data/SafeWritableBuffer.java:377— processing/src/main/java/org/apache/druid/segment/data/SafeWritableBuffer.java:377-390 | processing/src/main/java/org/apache/druid/segment/data/SafeWritableMemory.java:186-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:265— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:265-278 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:198-211 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:755— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:755-768 | processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:835-848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:461— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:461-474 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:510-523 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:461` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java:108— sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java:108-121 | sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java:146-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
+ 3 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×27
Edited copy of a member (18 corresponding lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:175— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:175-192 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:236-263 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/segment/IncrementalIndexSegment.java:59— processing/src/main/java/org/apache/druid/segment/IncrementalIndexSegment.java:59-76 | processing/src/main/java/org/apache/druid/segment/QueryableIndexSegment.java:77-103 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/indexer/TaskStatusPlus.java:204— processing/src/main/java/org/apache/druid/indexer/TaskStatusPlus.java:204-222 | server/src/main/java/org/apache/druid/server/compaction/ReindexingDataSchemaRule.java:126-143 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:268— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:268-285 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:313-334 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:217— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:217-237 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:669-686 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorFactory.java:141— processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorFactory.java:141-169 | processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorFactory.java:325-342 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:2223— processing/src/main/java/org/apache/druid/math/expr/Function.java:2223-2240 | processing/src/main/java/org/apache/druid/math/expr/Function.java:2297-2314 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java:50— extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java:50-67 | extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java:59-78 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java:36— processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java:36-53 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateProcessorFactory.java:36-53 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:79— processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:79-96 | processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:159-178 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FixedIndexedIntWriter.java:83— processing/src/main/java/org/apache/druid/segment/data/FixedIndexedIntWriter.java:83-100 | processing/src/main/java/org/apache/druid/segment/data/FixedIndexedWriter.java:134-153 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:192— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:192-209 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java:283-304 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/PooledTopNAlgorithm.java:427— processing/src/main/java/org/apache/druid/query/topn/PooledTopNAlgorithm.java:427-444 | processing/src/main/java/org/apache/druid/query/topn/PooledTopNAlgorithm.java:451-471 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/JodaUtils.java:187— processing/src/main/java/org/apache/druid/java/util/common/JodaUtils.java:187-204 | processing/src/main/java/org/apache/druid/java/util/common/JodaUtils.java:207-224 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) server/src/main/java/org/apache/druid/server/audit/SQLAuditManager.java:164— server/src/main/java/org/apache/druid/server/audit/SQLAuditManager.java:164-182 | server/src/main/java/org/apache/druid/server/audit/SQLAuditManager.java:204-221 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2402— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2402-2419 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2434-2451 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:247— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:247-267 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:262-279 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/AbstractTask.java:335— indexing-service/src/main/java/org/apache/druid/indexing/common/task/AbstractTask.java:335-358 | server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorReport.java:72-89 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:593— processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:593-610 | processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:640-660 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordRedirectInfo.java:58— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordRedirectInfo.java:58-75 | server/src/main/java/org/apache/druid/server/http/CoordinatorRedirectInfo.java:56-74 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:288— multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:288-311 | multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:319-336 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:522— indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:522-539 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:799-816 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcInputFormat.java:62— extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcInputFormat.java:62-79 | extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/ParquetInputFormat.java:59-76 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/segment/join/FrameBasedInlineJoinableFactory.java:46— processing/src/main/java/org/apache/druid/segment/join/FrameBasedInlineJoinableFactory.java:46-63 | processing/src/main/java/org/apache/druid/segment/join/InlineJoinableFactory.java:51-71 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarMultiIntsSupplier.java:87— processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarMultiIntsSupplier.java:87-104 | processing/src/main/java/org/apache/druid/segment/data/V3CompressedVSizeColumnarMultiIntsSupplier.java:64-81 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Hotspot: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:426— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in SeekableStreamIndexTaskRunner.runInternal at line 426. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx:183— web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 106 in execution-stages-pane.ExecutionStagesPane at line 183. 2 of those changes were fix/bug commits, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: distribution/bin/check-licenses.py distribution/bin/check-licenses.py:475— distribution/bin/check-licenses.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in check-licenses.check_licenses at line 475. 3 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- distribution/bin/check-licenses.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:137— web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in result-table-pane.ResultTablePane at line 137. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:265— web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 98 in schema-step.SchemaStep at line 265. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/views/datasources-view/datasources-view.tsx web-console/src/views/datasources-view/datasources-view.tsx:1177— web-console/src/views/datasources-view/datasources-view.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in DatasourcesView.renderDatasourcesTable at line 1177. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/views/datasources-view/datasources-view.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/components/segment-timeline/segment-bar-chart-render.tsx web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:201— web-console/src/components/segment-timeline/segment-bar-chart-render.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in segment-bar-chart-render.SegmentBarChartRender at line 201. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/components/segment-timeline/segment-bar-chart-render.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java:68— sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in DruidRexExecutor.reduce at line 68. 2 of those changes were fix/bug commits, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1445— indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in HttpRemoteTaskRunner.taskAddedOrUpdated at line 1445. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/views/workbench-view/query-tab/query-tab.tsx web-console/src/views/workbench-view/query-tab/query-tab.tsx:108— web-console/src/views/workbench-view/query-tab/query-tab.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in query-tab.QueryTab at line 108. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/views/workbench-view/query-tab/query-tab.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:179— indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in 7383.call at line 179. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1139— server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in SegmentLocalCacheManager.realizeRuleOrRestorePrior at line 1139. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java:181— server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in JettyServerModule.makeAndInitializeServer at line 181. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1146— sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in DruidQuery.toTimeseriesQuery at line 1146. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:753— server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PartialSegmentMetadataCacheEntry.doMount at line 753. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:120— web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in filter-menu.FilterMenu at line 120. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/editor-completions/sql-completions.ts web-console/src/editor-completions/sql-completions.ts:236— web-console/src/editor-completions/sql-completions.ts changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in sql-completions.getSqlCompletions at line 236. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/editor-completions/sql-completions.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: distribution/bin/refresh-license-versions.py distribution/bin/refresh-license-versions.py:76— distribution/bin/refresh-license-versions.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in refresh-license-versions.refresh_versions at line 76. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- distribution/bin/refresh-license-versions.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java:107— processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in NettyHttpClient.go at line 107. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/components/fancy-numeric-input/fancy-numeric-input.tsx web-console/src/components/fancy-numeric-input/fancy-numeric-input.tsx:86— web-console/src/components/fancy-numeric-input/fancy-numeric-input.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in fancy-numeric-input.FancyNumericInput at line 86. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/components/fancy-numeric-input/fancy-numeric-input.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:164— indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in 6675.call at line 164. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx:129— web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in column-editor.ColumnEditor at line 129. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java:81— extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in HdfsDataSegmentKiller.kill at line 81. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java:318— extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in ServerSideEncryptingAmazonS3.builder at line 318. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: web-console/src/components/json-input/json-input.tsx web-console/src/components/json-input/json-input.tsx:101— web-console/src/components/json-input/json-input.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in json-input.JsonInput at line 101. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- web-console/src/components/json-input/json-input.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (17 lines × 2) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQueryRunner.java:131— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQueryRunner.java:131-147 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQueryRunner.java:171-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:215— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:215-231 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:194-210 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:232` calls `getRecordBufferSizeConfigured`, `getRecordBufferOfferTimeout` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:211` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:177— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:177-193 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:139-155 — before extracting anything, compare `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:177` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:250— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:250-266 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java:165-181 — before extracting anything, compare `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java` and `extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:250` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java:155— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java:155-171 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:255-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java:155` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1010— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1010-1026 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTask.java:458-474 — before extracting anything, compare `indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java` and `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTask.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1010` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/SwitchingTaskLogStreamer.java:70— indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/SwitchingTaskLogStreamer.java:70-86 | indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/SwitchingTaskLogStreamer.java:109-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/SwitchingTaskLogStreamer.java:70` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:410— indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:410-426 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/SimpleWorkerProvisioningStrategy.java:255-271 — before extracting anything, compare `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java` and `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/SimpleWorkerProvisioningStrategy.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:410` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/security/TaskResourceFilter.java:90— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/security/TaskResourceFilter.java:90-106 | server/src/main/java/org/apache/druid/server/http/security/RulesResourceFilter.java:73-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/security/TaskResourceFilter.java:90` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:154— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:154-170 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamStartSequenceNumbers.java:168-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:154` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/frame/processor/FrameChannelHashPartitioner.java:180— processing/src/main/java/org/apache/druid/frame/processor/FrameChannelHashPartitioner.java:180-196 | processing/src/main/java/org/apache/druid/frame/processor/FrameChannelMixer.java:71-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/processor/FrameChannelHashPartitioner.java:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:244— processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:244-260 | processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:399-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:87— processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:87-103 | processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:128-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:247— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:247-263 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouper.java:361-377 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:247` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexIO.java:1142— processing/src/main/java/org/apache/druid/segment/IndexIO.java:1142-1158 | processing/src/main/java/org/apache/druid/segment/IndexIO.java:1197-1213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/IndexIO.java:1142` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:273— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:273-289 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:390-406 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:273` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:650— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:650-666 | processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:798-814 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:620— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:620-636 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:460-476 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:620` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:114— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:114-130 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:124-140 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `byte[]` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:367— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:367-383 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:329-345 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:367` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:805— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:805-821 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:429-445 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:805` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:366— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:366-382 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:699-715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:366` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:681— server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:681-697 | server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:1058-1074 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:819— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:819-835 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:954-970 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:819` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) server/src/main/java/org/apache/druid/segment/loading/LeastBytesUsedStorageLocationSelectorStrategy.java:43— server/src/main/java/org/apache/druid/segment/loading/LeastBytesUsedStorageLocationSelectorStrategy.java:43-59 | server/src/main/java/org/apache/druid/segment/loading/MostAvailableSizeStorageLocationSelectorStrategy.java:44-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Swallowed exception (empty catch) web-console/src/views/workbench-view/query-tab/query-tab.tsx:241— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) web-console/src/views/workbench-view/query-tab/query-tab.tsx:288— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) web-console/src/views/load-data-view/load-data-view.tsx:3616— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/utils/download-query-detail-archive.ts:49— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/utils/download-query-detail-archive.ts:53— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/utils/download-query-detail-archive.ts:57— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/utils/download-query-detail-archive.ts:63— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/utils/download-query-detail-archive.ts:67— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/utils/hash-routing.ts:46— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/utils/query-manager/query-manager.ts:300— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/singletons/api.ts:64— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/helpers/execution/sql-task-execution.ts:255— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) web-console/src/druid-models/workbench-query/workbench-query.ts:324— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/dialogs/show-value-dialog/show-value-dialog.tsx:54— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web-console/src/components/code-editor/code-editor.tsx:310— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:1109— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) processing/src/main/java/org/apache/druid/segment/ReferenceCountingCloseableObject.java:60— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) processing/src/main/java/org/apache/druid/collections/ReferenceCountingResourceHolder.java:182— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) processing/src/main/java/org/apache/druid/collections/ReferenceCountingResourceHolder.java:190— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) processing/src/main/java/org/apache/druid/collections/StupidPool.java:361— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/FutureReadableFrameChannel.java:107— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `close()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
Swallowed exception (empty catch) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:270— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:544— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/DartWorkerManager.java:209— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/DartWorkerManager.java:219— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×24
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java:124— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java:124-146 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java:153-173 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorConditionalProcessors.java:108— processing/src/main/java/org/apache/druid/math/expr/vector/VectorConditionalProcessors.java:108-128 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorConditionalProcessors.java:135-155 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/Historical1SimpleDoubleAggPooledTopNScannerPrototype.java:60— processing/src/main/java/org/apache/druid/query/topn/Historical1SimpleDoubleAggPooledTopNScannerPrototype.java:60-85 | processing/src/main/java/org/apache/druid/query/topn/HistoricalSingleValueDimSelector1SimpleDoubleAggPooledTopNScannerPrototype.java:60-80 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java:325— processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java:325-348 | processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java:357-377 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:785— sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:785-805 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:814-834 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/FallbackVectorProcessor.java:278— processing/src/main/java/org/apache/druid/math/expr/vector/FallbackVectorProcessor.java:278-298 | processing/src/main/java/org/apache/druid/math/expr/vector/FallbackVectorProcessor.java:329-349 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:515— processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:515-538 | processing/src/main/java/org/apache/druid/segment/SimpleDictionaryMergingIterator.java:82-102 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:1104— processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:1104-1124 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:634-657 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/segment/writeout/FileWriteOutBytes.java:98— processing/src/main/java/org/apache/druid/segment/writeout/FileWriteOutBytes.java:98-125 | processing/src/main/java/org/apache/druid/segment/writeout/LegacyFileWriteOutBytes.java:90-110 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:412— processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:412-432 | processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:407-428 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rel/logical/DruidValues.java:84— sql/src/main/java/org/apache/druid/sql/calcite/rel/logical/DruidValues.java:84-104 | sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRule.java:62-85 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/MultiContainerTaskAdapter.java:103— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/MultiContainerTaskAdapter.java:103-128 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/SingleContainerTaskAdapter.java:91-111 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) server/src/main/java/org/apache/druid/server/security/AuthorizationUtils.java:310— server/src/main/java/org/apache/druid/server/security/AuthorizationUtils.java:310-330 | server/src/main/java/org/apache/druid/server/security/AuthorizationUtils.java:374-398 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchComplexMetricSerde.java:53— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchComplexMetricSerde.java:53-75 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchComplexMetricSerde.java:52-72 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) server/src/main/java/org/apache/druid/server/QueryLifecycle.java:272— server/src/main/java/org/apache/druid/server/QueryLifecycle.java:272-292 | server/src/main/java/org/apache/druid/server/QueryLifecycle.java:310-330 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:232— indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:232-253 | indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:257-277 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/data/input/impl/CloudObjectInputSource.java:335— processing/src/main/java/org/apache/druid/data/input/impl/CloudObjectInputSource.java:335-355 | processing/src/main/java/org/apache/druid/data/input/impl/CloudObjectInputSource.java:373-393 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:136— server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:136-157 | server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java:129-149 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityBufferAggregator.java:54— processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityBufferAggregator.java:54-74 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/StringObjectCardinalityVectorProcessor.java:41-62 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java:269— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java:269-289 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/VectorGroupByEngine.java:175-202 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestGenerateSketchSqlAggregator.java:145— extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestGenerateSketchSqlAggregator.java:145-169 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregator.java:171-191 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/input/GeneratorInputSource.java:167— indexing-service/src/main/java/org/apache/druid/indexing/input/GeneratorInputSource.java:167-189 | indexing-service/src/main/java/org/apache/druid/indexing/input/GeneratorInputSource.java:193-213 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:2064— server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:2064-2084 | server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:2091-2113 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskIOConfig.java:123— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskIOConfig.java:123-143 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskIOConfig.java:128-148 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×24
Edited copy of a member (6 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerControllerContext.java:233— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerControllerContext.java:233-241 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerWorkerContext.java:286-291 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/guice/ExtensionFirstClassLoader.java:99— processing/src/main/java/org/apache/druid/guice/ExtensionFirstClassLoader.java:99-105 | processing/src/main/java/org/apache/druid/guice/StandardURLClassLoader.java:77-82 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/SafeWritableMemory.java:212— processing/src/main/java/org/apache/druid/segment/data/SafeWritableMemory.java:212-219 | processing/src/main/java/org/apache/druid/segment/data/SafeWritableBuffer.java:81-86 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildBufferAggregatorHelper.java:50— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildBufferAggregatorHelper.java:50-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchMergeBufferAggregatorHelper.java:51-56 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:82— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:82-88 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchMergeBufferAggregator.java:61-66 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/balancer/TierSegmentBalancer.java:192— server/src/main/java/org/apache/druid/server/coordinator/balancer/TierSegmentBalancer.java:192-197 | server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:1178-1183 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:150— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:150-156 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchMergeBufferAggregator.java:94-99 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/timeline/partition/IntegerPartitionChunk.java:116— processing/src/main/java/org/apache/druid/timeline/partition/IntegerPartitionChunk.java:116-121 | processing/src/main/java/org/apache/druid/timeline/partition/StringPartitionChunk.java:127-132 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/segment/writeout/LegacyTmpFileSegmentWriteOutMedium.java:36— processing/src/main/java/org/apache/druid/segment/writeout/LegacyTmpFileSegmentWriteOutMedium.java:36-41 | processing/src/main/java/org/apache/druid/segment/writeout/TmpFileSegmentWriteOutMedium.java:64-71 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/DoubleBivariateFunctionVectorProcessor.java:44— processing/src/main/java/org/apache/druid/math/expr/vector/DoubleBivariateFunctionVectorProcessor.java:44-49 | processing/src/main/java/org/apache/druid/math/expr/vector/LongBivariateFunctionVectorProcessor.java:44-49 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:321— sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:321-329 | sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java:745-750 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchHolderObjectStrategy.java:51— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchHolderObjectStrategy.java:51-56 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchHolderObjectStrategy.java:49-55 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/DurableStorageConfigurationFault.java:62— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/DurableStorageConfigurationFault.java:62-67 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/InvalidFieldFault.java:106-114 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/rpc/MSQResourceUtils.java:41— multi-stage-query/src/main/java/org/apache/druid/msq/rpc/MSQResourceUtils.java:41-53 | server/src/main/java/org/apache/druid/server/security/LookupAuthorizationUtils.java:51-56 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) server/src/main/java/org/apache/druid/client/BrokerServerView.java:263— server/src/main/java/org/apache/druid/client/BrokerServerView.java:263-268 | server/src/main/java/org/apache/druid/client/CoordinatorServerView.java:165-171 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/io/smoosh/FileSmoosher.java:507— processing/src/main/java/org/apache/druid/java/util/common/io/smoosh/FileSmoosher.java:507-512 | processing/src/main/java/org/apache/druid/segment/file/SegmentFileBuilderV10.java:735-745 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/segment/projections/ClusteringColumnSelectorFactory.java:111— processing/src/main/java/org/apache/druid/segment/projections/ClusteringColumnSelectorFactory.java:111-116 | processing/src/main/java/org/apache/druid/segment/projections/ClusteringVectorColumnSelectorFactory.java:80-86 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramBufferAggregatorHelper.java:38— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramBufferAggregatorHelper.java:38-43 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingBufferAggregatorHelper.java:54-61 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:868— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:868-873 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:491-496 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1165— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1165-1170 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:478-483 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:54— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:54-60 | processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java:72-77 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:507— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:507-512 | processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:557-562 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPreShuffleFrameProcessor.java:311— multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPreShuffleFrameProcessor.java:311-316 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryFrameProcessor.java:223-228 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlIngest.java:91— sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlIngest.java:91-98 | sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlReplace.java:121-126 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×23
Edited copy of a member (20 corresponding lines) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:645— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:645-670 | processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:793-834 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:207— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:207-226 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:273-292 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:963— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:963-982 | processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:987-1012 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/GlobalTaskLockbox.java:330— indexing-service/src/main/java/org/apache/druid/indexing/overlord/GlobalTaskLockbox.java:330-349 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/GlobalTaskLockbox.java:356-375 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:506— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:506-525 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:651-671 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:161— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:161-180 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java:247-269 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:4365— processing/src/main/java/org/apache/druid/math/expr/Function.java:4365-4385 | processing/src/main/java/org/apache/druid/math/expr/Function.java:4519-4538 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) server/src/main/java/org/apache/druid/server/ClientInfoResource.java:232— server/src/main/java/org/apache/druid/server/ClientInfoResource.java:232-251 | server/src/main/java/org/apache/druid/server/ClientInfoResource.java:262-281 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java:438— processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java:438-457 | processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java:461-480 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:436— processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:436-455 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:520-548 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:355— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:355-385 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTask.java:498-517 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:161— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:161-181 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:268-287 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/LoadingLookupFactory.java:133— extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/LoadingLookupFactory.java:133-152 | extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookupFactory.java:150-170 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) server/src/main/java/org/apache/druid/client/DirectDruidClient.java:547— server/src/main/java/org/apache/druid/client/DirectDruidClient.java:547-576 | server/src/main/java/org/apache/druid/discovery/DataServerResponseHandler.java:169-188 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentPusher.java:82— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentPusher.java:82-101 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleTaskLogs.java:92-116 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:401— extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:401-430 | extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeDiscoveryProvider.java:349-368 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:255— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:255-278 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:399-418 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/data/input/aliyun/OssEntity.java:56— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/data/input/aliyun/OssEntity.java:56-75 | extensions-core/s3-extensions/src/main/java/org/apache/druid/data/input/s3/S3Entity.java:68-88 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:397— sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:397-418 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestBySqlAggregator.java:171-190 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeComplexMetricSerde.java:75— extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeComplexMetricSerde.java:75-94 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeComplexMetricSerde.java:46-68 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchModule.java:41— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchModule.java:41-60 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchModule.java:45-64 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentPusher.java:209— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentPusher.java:209-228 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPusher.java:186-205 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnSerializer.java:69— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnSerializer.java:69-88 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnSerializer.java:70-89 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×23
Edited copy of a member (22 corresponding lines) server/src/main/java/org/apache/druid/client/indexing/ClientCompactionTaskQuery.java:201— server/src/main/java/org/apache/druid/client/indexing/ClientCompactionTaskQuery.java:201-222 | server/src/main/java/org/apache/druid/server/coordinator/InlineSchemaDataSourceCompactionConfig.java:265-289 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/Filters.java:250— processing/src/main/java/org/apache/druid/segment/filter/Filters.java:250-271 | processing/src/main/java/org/apache/druid/segment/filter/Filters.java:294-315 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregatorFactory.java:93— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregatorFactory.java:93-114 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregatorFactory.java:118-149 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java:80— processing/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java:80-101 | processing/src/main/java/org/apache/druid/math/expr/vector/FunctionErrorReportingExprVectorProcessor.java:45-66 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:98— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:98-130 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:77-98 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:727— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:727-748 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1025-1046 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/parsers/TimestampParser.java:149— processing/src/main/java/org/apache/druid/java/util/common/parsers/TimestampParser.java:149-170 | processing/src/main/java/org/apache/druid/query/expression/TimestampParseExprMacro.java:110-134 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:387— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:387-409 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:401-422 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:172— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:172-193 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java:109-130 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:176— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:176-197 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamStartSequenceNumbers.java:190-220 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:3726— processing/src/main/java/org/apache/druid/math/expr/Function.java:3726-3747 | processing/src/main/java/org/apache/druid/math/expr/Function.java:3767-3789 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java:707— processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java:707-728 | processing/src/main/java/org/apache/druid/segment/incremental/OnHeapAggregateProjection.java:328-349 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/duty/OverlordMetadataCleanupDuty.java:60— indexing-service/src/main/java/org/apache/druid/indexing/overlord/duty/OverlordMetadataCleanupDuty.java:60-81 | server/src/main/java/org/apache/druid/server/coordinator/duty/MetadataCleanupDuty.java:71-97 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/query/BySegmentResultValueClass.java:96— processing/src/main/java/org/apache/druid/query/BySegmentResultValueClass.java:96-117 | processing/src/main/java/org/apache/druid/query/SegmentDescriptor.java:82-103 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardConverter.java:58— extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardConverter.java:58-80 | extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/DimensionConverter.java:56-77 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/ArrayCompressedBigDecimal.java:227— extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/ArrayCompressedBigDecimal.java:227-249 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/ByteBufferCompressedBigDecimal.java:141-162 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/SendAllGraphiteEventConverter.java:125— extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/SendAllGraphiteEventConverter.java:125-146 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:235-259 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1176— processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1176-1198 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:816-837 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:89— processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:89-110 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:108-131 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssObjectSummaryIterator.java:123— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssObjectSummaryIterator.java:123-144 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ObjectSummaryIterator.java:155-177 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookup.java:113— extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookup.java:113-134 | extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookup.java:138-160 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:87— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:87-108 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java:135-156 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/io/smoosh/SmooshedFileMapper.java:153— processing/src/main/java/org/apache/druid/java/util/common/io/smoosh/SmooshedFileMapper.java:153-174 | processing/src/main/java/org/apache/druid/segment/file/SegmentInternalFileMap.java:153-174 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×22
Edited copy of a member (5 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java:722— indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java:722-726 | indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java:730-734 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerHolder.java:379— multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerHolder.java:379-390 | multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:381-385 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/frame/channel/ReadableInputStreamFrameChannel.java:254— processing/src/main/java/org/apache/druid/frame/channel/ReadableInputStreamFrameChannel.java:254-258 | processing/src/main/java/org/apache/druid/java/util/common/RetryUtils.java:227-235 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java:34— processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java:34-38 | processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceLongVectorProcessor.java:34-38 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthCommonCacheConfig.java:50— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthCommonCacheConfig.java:50-55 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClientConfig.java:48-52 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:33— processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:33-37 | processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedLongVectorProcessor.java:33-37 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/GroupByVectorColumnProcessorFactory.java:152— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/GroupByVectorColumnProcessorFactory.java:152-156 | processing/src/main/java/org/apache/druid/segment/ColumnProcessors.java:396-400 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/query/QueryContexts.java:955— processing/src/main/java/org/apache/druid/query/QueryContexts.java:955-959 | server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java:415-421 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/LongFirstLastVectorAggregator.java:89— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/LongFirstLastVectorAggregator.java:89-93 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/SingleStringFirstLastDimensionVectorAggregator.java:93-100 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/segment/virtual/ExpressionVectorMultiValueStringObjectSelector.java:44— processing/src/main/java/org/apache/druid/segment/virtual/ExpressionVectorMultiValueStringObjectSelector.java:44-48 | processing/src/main/java/org/apache/druid/segment/virtual/ExpressionVectorValueSelector.java:44-48 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/segment/virtual/PrefixFilteredVirtualColumn.java:57— processing/src/main/java/org/apache/druid/segment/virtual/PrefixFilteredVirtualColumn.java:57-61 | processing/src/main/java/org/apache/druid/segment/virtual/RegexFilteredVirtualColumn.java:57-61 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/schema/ViewSchema.java:53— sql/src/main/java/org/apache/druid/sql/calcite/schema/ViewSchema.java:53-58 | sql/src/main/java/org/apache/druid/sql/calcite/schema/ViewSchemaProvider.java:43-47 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarMultiIntsSupplier.java:76— processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarMultiIntsSupplier.java:76-80 | processing/src/main/java/org/apache/druid/segment/data/V3CompressedVSizeColumnarMultiIntsSerializer.java:135-140 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/DoubleUnivariateFunctionVectorProcessor.java:41— processing/src/main/java/org/apache/druid/math/expr/vector/DoubleUnivariateFunctionVectorProcessor.java:41-45 | processing/src/main/java/org/apache/druid/math/expr/vector/LongUnivariateFunctionVectorProcessor.java:41-45 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/http/DartWorkerResource.java:161— multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/http/DartWorkerResource.java:161-165 | multi-stage-query/src/main/java/org/apache/druid/msq/rpc/ControllerResource.java:121-125 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:102— processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:102-106 | processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java:91-95 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) server/src/main/java/org/apache/druid/client/cache/BackgroundCachePopulator.java:63— server/src/main/java/org/apache/druid/client/cache/BackgroundCachePopulator.java:63-68 | server/src/main/java/org/apache/druid/client/cache/ForegroundCachePopulator.java:54-58 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroStreamReader.java:76— extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroStreamReader.java:76-80 | extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufReader.java:70-74 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/query/FilteredDataSource.java:141— processing/src/main/java/org/apache/druid/query/FilteredDataSource.java:141-147 | processing/src/main/java/org/apache/druid/query/RestrictedDataSource.java:147-151 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleFull.java:47— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleFull.java:47-52 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleSimplifiedPermissions.java:63-67 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:239— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:239-244 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:255-259 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchHolderObjectStrategy.java:74— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchHolderObjectStrategy.java:74-80 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchObjectStrategy.java:70-74 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (8 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:57— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:57-64 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:57-64 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:57-64 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:573— processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:573-580 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:627-634 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:667-674 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:667` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:54— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:54-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java:54-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongSubProcessor.java:54-61 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:316— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:316-323 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:366-373 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:328-335 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:220— server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:220-227 | server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:256-263 | server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:315-322 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:798— sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:798-805 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:827-834 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:868-875 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:798` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:529— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:529-536 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:600-607 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:671-678 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:529` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:555— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:555-562 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:626-633 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:697-704 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:555` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:166— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:166-173 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:166-173 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:166-173 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:205— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:205-212 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:205-212 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:205-212 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:287— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:287-294 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:499-506 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTask.java:328-335 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:276— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:276-283 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:276-283 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:275-282 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:245— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:245-252 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:245-252 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:293-300 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:172— processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:172-179 | processing/src/main/java/org/apache/druid/segment/virtual/PrefixFilteredVirtualColumn.java:126-133 | processing/src/main/java/org/apache/druid/segment/virtual/RegexFilteredVirtualColumn.java:126-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:148— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:148-155 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java:233-240 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisor.java:263-270 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:401— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:401-408 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java:517-524 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisor.java:425-433 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildBufferAggregator.java:41— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildBufferAggregator.java:41-48 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchBuildBufferAggregator.java:41-48 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildBufferAggregator.java:54-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java:120— processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java:120-127 | processing/src/main/java/org/apache/druid/query/aggregation/any/FloatAnyAggregatorFactory.java:117-124 | processing/src/main/java/org/apache/druid/query/aggregation/any/LongAnyAggregatorFactory.java:116-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java:59— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java:59-66 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FloatFirstLastVectorAggregator.java:59-66 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/SingleStringFirstLastDimensionVectorAggregator.java:59-66 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FloatFirstLastVectorAggregator.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:151— processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:151-158 | processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java:152-160 | processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java:152-160 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java` and `processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/segment/projections/ClusteringColumnSelectorFactory.java:475— processing/src/main/java/org/apache/druid/segment/projections/ClusteringColumnSelectorFactory.java:475-482 | processing/src/main/java/org/apache/druid/segment/projections/ClusteringVectorColumnSelectorFactory.java:362-369 | processing/src/main/java/org/apache/druid/segment/projections/ClusteringVectorColumnSelectorFactory.java:423-430 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) processing/src/main/java/org/apache/druid/segment/selector/settable/SettableDoubleColumnValueSelector.java:32— processing/src/main/java/org/apache/druid/segment/selector/settable/SettableDoubleColumnValueSelector.java:32-39 | processing/src/main/java/org/apache/druid/segment/selector/settable/SettableFloatColumnValueSelector.java:32-39 | processing/src/main/java/org/apache/druid/segment/selector/settable/SettableLongColumnValueSelector.java:32-39 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/selector/settable/SettableDoubleColumnValueSelector.java` and `processing/src/main/java/org/apache/druid/segment/selector/settable/SettableFloatColumnValueSelector.java` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToMeansPostAggregator.java:61— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToMeansPostAggregator.java:61-67 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToMetricsSumEstimatePostAggregator.java:64-70 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToVariancesPostAggregator.java:61-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) indexing-service/src/main/java/org/apache/druid/indexing/overlord/BaseRestorableTaskRunner.java:146— indexing-service/src/main/java/org/apache/druid/indexing/overlord/BaseRestorableTaskRunner.java:146-152 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/SingleTaskBackgroundRunner.java:114-120 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:994-1000 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1073— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1073-1079 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1087-1093 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1328-1334 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1073` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1070` calls `ColumnMetadata` and `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1084` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMaxVectorAggregator.java:85— processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMaxVectorAggregator.java:85-91 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdFloatMaxVectorAggregator.java:85-91 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdLongMaxVectorAggregator.java:85-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMaxVectorAggregator.java:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMinVectorAggregator.java:85— processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMinVectorAggregator.java:85-91 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdFloatMinVectorAggregator.java:85-91 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdLongMinVectorAggregator.java:85-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMinVectorAggregator.java:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:98— processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:98-104 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:129-135 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:275-281 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:628— server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:628-634 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:885-891 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:931-937 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:628` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramBufferAggregator.java:69— extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramBufferAggregator.java:69-75 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramNumericVectorizedAggregator.java:94-100 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramVectorizedAggregator.java:95-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:108— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:108-114 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToCDFPostAggregator.java:108-114 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToCDFPostAggregator.java:108-114 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToCDFPostAggregator.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:128— processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:128-134 | processing/src/main/java/org/apache/druid/segment/FloatColumnSerializerV2.java:128-134 | processing/src/main/java/org/apache/druid/segment/LongColumnSerializerV2.java:151-157 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java` and `processing/src/main/java/org/apache/druid/segment/FloatColumnSerializerV2.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:138— processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:138-144 | processing/src/main/java/org/apache/druid/segment/FloatColumnSerializerV2.java:138-144 | processing/src/main/java/org/apache/druid/segment/LongColumnSerializerV2.java:161-167 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java` and `processing/src/main/java/org/apache/druid/segment/FloatColumnSerializerV2.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/BasicAuthenticatorResource.java:159— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/BasicAuthenticatorResource.java:159-166 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/BasicAuthenticatorResource.java:186-192 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/BasicAuthorizerResource.java:206-213 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/DoubleBloomFilterAggregator.java:36— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/DoubleBloomFilterAggregator.java:36-42 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/FloatBloomFilterAggregator.java:36-42 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/LongBloomFilterAggregator.java:36-42 — before extracting anything, compare `extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/DoubleBloomFilterAggregator.java` and `extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/FloatBloomFilterAggregator.java` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/frame/field/DoubleArrayFieldReader.java:60— processing/src/main/java/org/apache/druid/frame/field/DoubleArrayFieldReader.java:60-66 | processing/src/main/java/org/apache/druid/frame/field/FloatArrayFieldReader.java:60-66 | processing/src/main/java/org/apache/druid/frame/field/LongArrayFieldReader.java:52-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:76— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:76-82 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:76-82 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:77-83 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:125— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:125-131 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:125-131 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:124-130 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerde.java:76— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerde.java:76-82 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexMetricSerde.java:76-82 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexMetricSerde.java:76-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java:112— processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java:112-118 | processing/src/main/java/org/apache/druid/query/extraction/MatchingDimExtractionFn.java:52-58 | processing/src/main/java/org/apache/druid/query/extraction/TimeDimExtractionFn.java:111-117 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:54— processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:54-60 | processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java:54-60 | processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java:54-60 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java` and `processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:100— processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:100-106 | processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java:100-106 | processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java:100-106 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java` and `processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/segment/DoubleDimensionMergerV9.java:43— processing/src/main/java/org/apache/druid/segment/DoubleDimensionMergerV9.java:43-49 | processing/src/main/java/org/apache/druid/segment/FloatDimensionMergerV9.java:43-49 | processing/src/main/java/org/apache/druid/segment/LongDimensionMergerV9.java:43-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) processing/src/main/java/org/apache/druid/segment/column/DoublesColumn.java:39— processing/src/main/java/org/apache/druid/segment/column/DoublesColumn.java:39-45 | processing/src/main/java/org/apache/druid/segment/column/FloatsColumn.java:39-45 | processing/src/main/java/org/apache/druid/segment/column/LongsColumn.java:41-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `column` to `ColumnarDoubles` in one and `ColumnarFloats` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×18
Edited copy of a member (19 corresponding lines) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQuery.java:167— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQuery.java:167-187 | processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:915-941 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/HiveIcebergCatalog.java:110— extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/HiveIcebergCatalog.java:110-128 | extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageAuthentication.java:56-74 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1454— indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1454-1475 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1485-1503 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramNumericVectorizedAggregator.java:71— extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramNumericVectorizedAggregator.java:71-89 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramVectorizedAggregator.java:71-90 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) processing/src/main/java/org/apache/druid/crypto/CryptoService.java:107— processing/src/main/java/org/apache/druid/crypto/CryptoService.java:107-130 | processing/src/main/java/org/apache/druid/crypto/CryptoService.java:133-151 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:777— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:777-795 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:804-822 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:60— processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:60-78 | processing/src/main/java/org/apache/druid/segment/vector/ConcatenatingVectorCursor.java:66-84 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java:58— extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java:58-76 | extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/ParquetExtensionsModule.java:63-81 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) processing/src/main/java/org/apache/druid/query/dimension/ForwardingFilteredDimensionSelector.java:95— processing/src/main/java/org/apache/druid/query/dimension/ForwardingFilteredDimensionSelector.java:95-116 | processing/src/main/java/org/apache/druid/query/dimension/PredicateFilteredDimensionSelector.java:73-91 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:606— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:606-624 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:634-653 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/sql/DartSqlClientImpl.java:53— multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/sql/DartSqlClientImpl.java:53-74 | multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/sql/DartSqlClientImpl.java:78-96 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorIOConfig.java:129— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorIOConfig.java:129-147 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorIOConfig.java:274-297 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java:118— processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java:118-139 | processing/src/main/java/org/apache/druid/segment/filter/NotFilter.java:104-122 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/datasource/FilteredDataSourcePlanner.java:48— multi-stage-query/src/main/java/org/apache/druid/msq/querykit/datasource/FilteredDataSourcePlanner.java:48-66 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/datasource/UnnestDataSourcePlanner.java:48-76 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/GenericIndexedWriter.java:365— processing/src/main/java/org/apache/druid/segment/data/GenericIndexedWriter.java:365-383 | processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarMultiIntsSerializer.java:143-164 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) processing/src/main/java/org/apache/druid/segment/DimensionDictionary.java:80— processing/src/main/java/org/apache/druid/segment/DimensionDictionary.java:80-100 | processing/src/main/java/org/apache/druid/segment/DimensionDictionary.java:119-137 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) processing/src/main/java/org/apache/druid/segment/ReferenceCountingCloseableObject.java:48— processing/src/main/java/org/apache/druid/segment/ReferenceCountingCloseableObject.java:48-66 | server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:1097-1115 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) processing/src/main/java/org/apache/druid/segment/IndexMerger.java:413— processing/src/main/java/org/apache/druid/segment/IndexMerger.java:413-431 | processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:1015-1044 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×18
Members sharing a duplicated core (4 members, 50+ identical tokens) extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/sql/Bitmap64ExactCountSqlAggregator.java:154— extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/sql/Bitmap64ExactCountSqlAggregator.java:154-175 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:77-200 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/sql/ArrayOfDoublesSketchSqlAggregator.java:77-159 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/BuiltinApproxCountDistinctSqlAggregator.java:83-154 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java:307— extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java:307-322 | extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/mysql/MySQLConnector.java:295-310 | extensions-core/postgresql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/postgresql/PostgreSQLConnector.java:325-340 | server/src/main/java/org/apache/druid/metadata/storage/derby/DerbyConnector.java:192-207 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchTTestPostAggregator.java:98— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchTTestPostAggregator.java:98-109 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToMeansPostAggregator.java:56-70 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToMetricsSumEstimatePostAggregator.java:56-73 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToVariancesPostAggregator.java:56-70 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:979— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:979-1012 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1015-1048 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1051-1084 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1087-1120 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregator.java:70— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregator.java:70-79 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java:85-97 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java:85-97 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregator.java:85-97 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:293— indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:293-306 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:313-326 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:360-378 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:387-405 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:850— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:850-862 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1068-1079 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1083-1093 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1325-1334 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:116— processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:116-142 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:155-181 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:197-263 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:267-303 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:86— processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:86-115 | processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:127-155 | processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:164-231 | processing/src/main/java/org/apache/druid/segment/column/ColumnType.java:163-238 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerde.java:86— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerde.java:86-123 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexMetricSerde.java:87-124 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexMetricSerde.java:86-123 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:139-171 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleDeltaEncodedStagedSerde.java:39— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleDeltaEncodedStagedSerde.java:39-61 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatDeltaEncodedStagedSerde.java:39-61 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongDeltaEncodedStagedSerde.java:39-61 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:105-134 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:195— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:195-218 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:190-213 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:201-224 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:821-854 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:882— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:882-907 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:997-1019 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1041-1064 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1086-1110 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:929— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:929-949 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:997-1019 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1041-1064 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1086-1110 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1547— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1547-1628 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1640-1730 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:320-399 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:407-480 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:872— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:872-1056 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:132-187 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java:133-188 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:790-858 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:262— processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:262-284 | processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:291-313 | processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:320-342 | processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:349-377 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:208— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:208-255 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:387-441 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:518-575 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:683-739 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×16
Edited copies of one member (3 members, 15+ corresponding lines) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulMetrics.java:35— extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulMetrics.java:35-49 | extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulMetrics.java:52-66 | extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulMetrics.java:70-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/TimeChunkLock.java:177— indexing-service/src/main/java/org/apache/druid/indexing/common/TimeChunkLock.java:177-192 | indexing-service/src/main/java/org/apache/druid/indexing/input/DruidInputSource.java:476-490 | server/src/main/java/org/apache/druid/client/indexing/ClientKillUnusedSegmentsTaskQuery.java:135-150 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:173— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:173-187 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:639-655 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:629-644 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:938— processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:938-952 | processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryEngine.java:329-347 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryEngine.java:318-332 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1217— processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1217-1231 | processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1235-1249 | processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1253-1267 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/DefaultBasicAuthenticatorResourceHandler.java:114— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/DefaultBasicAuthenticatorResourceHandler.java:114-128 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/DefaultBasicAuthorizerResourceHandler.java:197-211 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/DefaultBasicAuthorizerResourceHandler.java:215-229 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) server/src/main/java/org/apache/druid/server/listener/resource/ListenerResource.java:85— server/src/main/java/org/apache/druid/server/listener/resource/ListenerResource.java:85-99 | server/src/main/java/org/apache/druid/server/listener/resource/ListenerResource.java:109-123 | server/src/main/java/org/apache/druid/server/listener/resource/ListenerResource.java:184-198 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:237— server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:237-251 | server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:255-269 | server/src/main/java/org/apache/druid/client/cache/MemcachedCache.java:273-287 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/query/QueryContexts.java:785— processing/src/main/java/org/apache/druid/query/QueryContexts.java:785-809 | processing/src/main/java/org/apache/druid/query/QueryContexts.java:827-850 | processing/src/main/java/org/apache/druid/query/QueryContexts.java:871-885 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleSimpleStagedSerde.java:38— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleSimpleStagedSerde.java:38-52 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatSimpleStagedSerde.java:38-52 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongSimpleStagedSerde.java:38-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramIndexed.java:53— extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramIndexed.java:53-71 | processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarInts.java:197-214 | processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarMultiInts.java:173-187 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:364— sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:364-378 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidJoinQueryRel.java:281-296 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidUnionDataSourceRel.java:169-183 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:99— processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:99-117 | processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:425-439 | processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:386-400 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSerializer.java:91— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSerializer.java:91-106 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSerializer.java:92-106 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSerializer.java:109-123 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:260— processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:260-274 | processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:279-293 | processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:297-311 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordCompactionResource.java:290— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordCompactionResource.java:290-304 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordCompactionResource.java:314-329 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordCompactionResource.java:340-362 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (10 lines × 3) extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregatorFactory.java:125— extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregatorFactory.java:125-134 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/min/CompressedBigDecimalMinAggregatorFactory.java:131-140 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/sum/CompressedBigDecimalSumAggregatorFactory.java:131-140 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:70— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:70-79 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:70-79 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:70-79 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:134— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:134-143 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:166-175 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:198-207 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:229— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:229-238 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:254-263 | server/src/main/java/org/apache/druid/server/http/MetadataResource.java:419-428 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:191— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:191-200 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:191-200 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:190-199 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:55— processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:55-64 | processing/src/main/java/org/apache/druid/frame/write/columnar/FloatFrameMaker.java:55-64 | processing/src/main/java/org/apache/druid/frame/write/columnar/LongFrameMaker.java:55-64 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java` and `processing/src/main/java/org/apache/druid/frame/write/columnar/FloatFrameMaker.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1218— processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1218-1227 | processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1236-1245 | processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1254-1263 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java:37— processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java:37-46 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateLongProcessorFactory.java:37-46 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateProcessorFactory.java:37-46 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateLongProcessorFactory.java` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathUnivariateDoubleProcessorFactory.java:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) processing/src/main/java/org/apache/druid/query/DimensionComparisonUtils.java:73— processing/src/main/java/org/apache/druid/query/DimensionComparisonUtils.java:73-85 | processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:1106-1115 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:639-648 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:255— processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:255-264 | processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:303-312 | processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:349-358 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:154— server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:154-164 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:391-400 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:444-453 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:189— services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:189-198 | services/src/main/java/org/apache/druid/cli/CliOverlord.java:359-368 | services/src/main/java/org/apache/druid/cli/CliPeon.java:488-497 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CliMiddleManager.java` and `services/src/main/java/org/apache/druid/cli/CliOverlord.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:213— server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:213-222 | server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:376-385 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:301-312 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:229— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:229-238 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:278-287 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:291-300 — before extracting anything, compare `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java` and `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:63— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:63-72 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:63-72 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:64-73 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) server/src/main/java/org/apache/druid/segment/metadata/SegmentSchemaManager.java:121— server/src/main/java/org/apache/druid/segment/metadata/SegmentSchemaManager.java:121-130 | server/src/main/java/org/apache/druid/segment/metadata/SqlIndexingStateStorage.java:238-247 | server/src/main/java/org/apache/druid/segment/metadata/SqlIndexingStateStorage.java:251-260 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 3) extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java:61— extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java:61-69 | extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java:71-79 | extensions-core/postgresql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java:72-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java:68` calls `bind` and `extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java:59` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureSegmentRangeReader.java:68— extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureSegmentRangeReader.java:68-76 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleSegmentRangeReader.java:59-67 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SegmentRangeReader.java:63-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureSegmentRangeReader.java:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java:77— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java:77-85 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchBuildVectorAggregator.java:77-85 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildVectorAggregator.java:77-85 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildVectorAggregator.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java:77` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:92— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:92-100 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:109-117 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:126-134 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:92` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:137— processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:137-145 | processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:157-165 | processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:177-185 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:47— processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:47-55 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java:47-55 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/LongCardinalityVectorProcessor.java:47-55 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java` and `processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:530— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:530-538 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:676-684 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:405-413 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:530` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `ByteBuffer` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 3) server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:159— server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:159-167 | server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:173-181 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:241-249 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:159` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java:628— sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java:628-636 | sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java:664-672 | sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java:720-728 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java:628` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:392— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:392-400 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:523-531 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:695-703 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:392` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:187— processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:187-195 | processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java:194-202 | processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java:188-196 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java` and `processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:286— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:286-294 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:286-294 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:285-293 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) processing/src/main/java/org/apache/druid/query/expression/TimestampCeilExprMacro.java:51— processing/src/main/java/org/apache/druid/query/expression/TimestampCeilExprMacro.java:51-59 | processing/src/main/java/org/apache/druid/query/expression/TimestampFloorExprMacro.java:75-83 | processing/src/main/java/org/apache/druid/query/expression/TimestampShiftExprMacro.java:51-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (9 lines × 3) processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:137— processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:137-145 | processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java:137-146 | processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java:137-146 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java` and `processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:186— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:186-194 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java:178-186 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:305-313 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java` and `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:137— sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:137-145 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidOuterQueryRel.java:101-109 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidUnionDataSourceRel.java:92-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:99— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:99-118 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentMover.java:121-140 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:99` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:162— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:162-181 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java:193-212 — before extracting anything, compare `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java` and `extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:162` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:215— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:215-234 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java:147-166 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:350— processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:350-369 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:568-587 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:247— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:247-266 | processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:463-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:232— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:232-251 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:174-193 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:232` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `ByteBuffer` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:134— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:134-153 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:142-161 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `byte[]` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:100— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:100-119 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:104-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (20 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:512— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:512-531 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:588-607 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:512` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) server/src/main/java/org/apache/druid/client/BrokerServerView.java:131— server/src/main/java/org/apache/druid/client/BrokerServerView.java:131-150 | server/src/main/java/org/apache/druid/client/CoordinatorServerView.java:92-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/client/BrokerServerView.java:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:367— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:367-386 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:415-434 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:367` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:979— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:979-998 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:1264-1283 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) services/src/main/java/org/apache/druid/cli/DumpSegment.java:374— services/src/main/java/org/apache/druid/cli/DumpSegment.java:374-393 | services/src/main/java/org/apache/druid/cli/DumpSegment.java:575-594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/src/main/java/org/apache/druid/cli/DumpSegment.java:374` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/src/main/java/org/apache/druid/cli/DumpSegment.java:574` calls `getSerializerProviderInstance` and `services/src/main/java/org/apache/druid/cli/DumpSegment.java:373` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 2) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:228— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:228-247 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java:143-162 — before extracting anything, compare `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java` and `extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorReportPayload.java:72— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorReportPayload.java:72-91 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorReportPayload.java:79-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesStorageDruidModule.java:56— extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesStorageDruidModule.java:56-73 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleStorageDruidModule.java:56-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesStorageDruidModule.java:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/server/ProtobufTransformer.java:78— extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/server/ProtobufTransformer.java:78-95 | extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/server/ProtobufTransformer.java:122-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/server/ProtobufTransformer.java:78` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQuery.java:169— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQuery.java:169-186 | processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:916-933 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:980— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:980-997 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1016-1033 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1052— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1052-1069 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1088-1105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/rpc/WorkerResource.java:250— multi-stage-query/src/main/java/org/apache/druid/msq/rpc/WorkerResource.java:250-267 | multi-stage-query/src/main/java/org/apache/druid/msq/rpc/WorkerResource.java:295-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/rpc/WorkerResource.java:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeFactory.java:103— processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeFactory.java:103-120 | processing/src/main/java/org/apache/druid/segment/column/ColumnTypeFactory.java:104-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/query/MetricsEmittingQueryRunner.java:93— processing/src/main/java/org/apache/druid/query/MetricsEmittingQueryRunner.java:93-110 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java:533-550 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/MetricsEmittingQueryRunner.java:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/query/MetricsEmittingQueryRunner.java:89` calls `getQueryMetrics`, `accept` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java:532` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyAggregator.java:58— processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyAggregator.java:58-75 | processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyBufferAggregator.java:72-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:163— processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:163-180 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:201-218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:68— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:68-85 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:200-217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:68` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:597— processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:597-614 | processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:812-829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:328— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:328-345 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:661-678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:328` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:347— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:347-364 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:680-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:347` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:294— processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:294-311 | processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:291-308 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Low cohesion: HeapMemoryDatasourceSegmentCache (LCOM4 14) server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemoryDatasourceSegmentCache.java:50— HeapMemoryDatasourceSegmentCache's methods fall into 14 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 14 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: FlattenJSONBenchmarkUtil (LCOM4 7) benchmarks/src/test/java/org/apache/druid/benchmark/FlattenJSONBenchmarkUtil.java:39— FlattenJSONBenchmarkUtil's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DruidConnection (LCOM4 7) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnection.java:58— DruidConnection's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: EqualityPredicateFactory (LCOM4 7) processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:363— EqualityPredicateFactory's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Builder (LCOM4 7) processing/src/main/java/org/apache/druid/query/context/QueryContextParameter.java:435— Builder's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: IndexMergerBase (LCOM4 6) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:76— IndexMergerBase's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CaffeineCache (LCOM4 5) server/src/main/java/org/apache/druid/client/cache/CaffeineCache.java:44— CaffeineCache's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ExecutorLifecycleConfig (LCOM4 4) indexing-service/src/main/java/org/apache/druid/indexing/worker/executor/ExecutorLifecycleConfig.java:32— ExecutorLifecycleConfig's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DartSqlEngine (LCOM4 4) multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/sql/DartSqlEngine.java:81— DartSqlEngine's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ExportResultsStageProcessor (LCOM4 4) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/results/ExportResultsStageProcessor.java:59— ExportResultsStageProcessor's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GroupingEngine (LCOM4 4) processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java:113— GroupingEngine's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: 3 (LCOM4 4) processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:282— 3's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DatasourceFacade (LCOM4 4) server/src/main/java/org/apache/druid/catalog/model/facade/DatasourceFacade.java:49— DatasourceFacade's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ApproximateHistogramBufferAggregatorHelper (LCOM4 4) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramBufferAggregatorHelper.java:28— ApproximateHistogramBufferAggregatorHelper's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: FixedBucketsHistogramBufferAggregatorHelper (LCOM4 4) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramBufferAggregatorHelper.java:30— FixedBucketsHistogramBufferAggregatorHelper's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Swallowed exception (caught, then discarded) web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:323— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/views/load-data-view/load-data-view.tsx:3604— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/utils/sql.ts:108— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/utils/local-storage-keys.tsx:109— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/hooks/use-hash-and-local-storage-hybrid-state.ts:41— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/helpers/capabilities.ts:105— `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/helpers/capabilities.ts:275— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/helpers/capacity.ts:40— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/dialogs/doctor-dialog/doctor-checks.tsx:137— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/dialogs/doctor-dialog/doctor-checks.tsx:181— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/dialogs/doctor-dialog/doctor-checks.tsx:376— `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) web-console/src/components/formatted-input/formatted-input.tsx:78— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) processing/src/main/java/org/apache/druid/query/QueryException.java:213— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnection.java:409— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/LocalTaskActionClient.java:128— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×14
Edited copy of a member (23 corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:231— processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:231-253 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:446-468 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:634— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:634-656 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:796-820 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/SendAllGraphiteEventConverter.java:99— extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/SendAllGraphiteEventConverter.java:99-121 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:208-231 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) server/src/main/java/org/apache/druid/server/initialization/jetty/ChatHandlerServerModule.java:59— server/src/main/java/org/apache/druid/server/initialization/jetty/ChatHandlerServerModule.java:59-81 | server/src/main/java/org/apache/druid/server/initialization/jetty/CliIndexerServerModule.java:59-101 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:98— processing/src/main/java/org/apache/druid/segment/ConcatenatingCursor.java:98-120 | processing/src/main/java/org/apache/druid/segment/vector/ConcatenatingVectorCursor.java:105-127 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) processing/src/main/java/org/apache/druid/data/input/impl/RegexReader.java:84— processing/src/main/java/org/apache/druid/data/input/impl/RegexReader.java:84-106 | processing/src/main/java/org/apache/druid/java/util/common/parsers/RegexParser.java:89-111 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:148— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamEndSequenceNumbers.java:148-170 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamStartSequenceNumbers.java:162-184 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:74— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportStorageProvider.java:74-96 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3ExportStorageProvider.java:129-151 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) processing/src/main/java/org/apache/druid/segment/vector/QueryableIndexVectorColumnSelectorFactory.java:180— processing/src/main/java/org/apache/druid/segment/vector/QueryableIndexVectorColumnSelectorFactory.java:180-202 | processing/src/main/java/org/apache/druid/segment/vector/QueryableIndexVectorColumnSelectorFactory.java:206-228 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:593— processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:593-615 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:846-868 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:530— indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:530-553 | indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:565-587 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulLeaderSelector.java:137— extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulLeaderSelector.java:137-159 | server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidLeaderSelector.java:173-199 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndexCursorHolder.java:147— processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndexCursorHolder.java:147-169 | processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndexCursorHolder.java:173-197 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) server/src/main/java/org/apache/druid/client/indexing/ClientCompactionTaskQueryTuningConfig.java:387— server/src/main/java/org/apache/druid/client/indexing/ClientCompactionTaskQueryTuningConfig.java:387-410 | server/src/main/java/org/apache/druid/server/coordinator/UserCompactionTaskQueryTuningConfig.java:258-280 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×14
Edited copies of one member (3 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableDoubleGroupByVectorColumnSelector.java:77— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableDoubleGroupByVectorColumnSelector.java:77-83 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableFloatGroupByVectorColumnSelector.java:77-83 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableLongGroupByVectorColumnSelector.java:77-83 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java:463— processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java:463-469 | processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java:473-479 | processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java:483-491 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:178— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:178-185 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:189-195 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:233-242 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DoubleWrappingDimensionSelector.java:45— processing/src/main/java/org/apache/druid/segment/DoubleWrappingDimensionSelector.java:45-51 | processing/src/main/java/org/apache/druid/segment/FloatWrappingDimensionSelector.java:42-48 | processing/src/main/java/org/apache/druid/segment/LongWrappingDimensionSelector.java:42-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountAggregator.java:44— extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountAggregator.java:44-50 | extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountBufferAggregator.java:53-61 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/StringCardinalityAggregatorColumnSelectorStrategy.java:83-90 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:425— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:425-431 | server/src/main/java/org/apache/druid/server/http/BrokerResource.java:57-63 | server/src/main/java/org/apache/druid/server/http/HistoricalResource.java:59-65 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/query/FilteredDataSource.java:98— processing/src/main/java/org/apache/druid/query/FilteredDataSource.java:98-104 | processing/src/main/java/org/apache/druid/query/RestrictedDataSource.java:103-109 | processing/src/main/java/org/apache/druid/query/UnnestDataSource.java:109-115 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchSetOpPostAggregator.java:128— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchSetOpPostAggregator.java:128-136 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToEstimateAndBoundsPostAggregator.java:87-93 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToQuantilesSketchPostAggregator.java:120-127 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameColumnWriter.java:43— processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameColumnWriter.java:43-49 | processing/src/main/java/org/apache/druid/frame/write/columnar/FloatFrameColumnWriter.java:43-49 | processing/src/main/java/org/apache/druid/frame/write/columnar/LongFrameColumnWriter.java:43-49 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/query/topn/types/DoubleTopNColumnAggregatesProcessor.java:49— processing/src/main/java/org/apache/druid/query/topn/types/DoubleTopNColumnAggregatesProcessor.java:49-55 | processing/src/main/java/org/apache/druid/query/topn/types/FloatTopNColumnAggregatesProcessor.java:49-55 | processing/src/main/java/org/apache/druid/query/topn/types/LongTopNColumnAggregatesProcessor.java:45-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/cache/polling/OffHeapPollingCache.java:98— extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/cache/polling/OffHeapPollingCache.java:98-104 | extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/cache/polling/OnHeapPollingCache.java:79-85 | multi-stage-query/src/main/java/org/apache/druid/msq/exec/DataServerQueryHandlerUtils.java:171-177 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernel.java:464— multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernel.java:464-471 | processing/src/main/java/org/apache/druid/common/utils/PropUtils.java:31-39 | processing/src/main/java/org/apache/druid/query/context/ResponseContext.java:539-545 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/segment/VirtualColumns.java:589— processing/src/main/java/org/apache/druid/segment/VirtualColumns.java:589-595 | processing/src/main/java/org/apache/druid/segment/join/table/RowBasedIndexedTable.java:192-200 | processing/src/main/java/org/apache/druid/timeline/SegmentDetail.java:101-107 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/collections/CloseableResourceHolder.java:43— processing/src/main/java/org/apache/druid/collections/CloseableResourceHolder.java:43-49 | processing/src/main/java/org/apache/druid/collections/StupidPool.java:283-290 | server/src/main/java/org/apache/druid/server/security/AuthorizationUtils.java:144-154 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×13
Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/hll/HyperLogLogCollector.java:177— processing/src/main/java/org/apache/druid/hll/HyperLogLogCollector.java:177-218 | processing/src/main/java/org/apache/druid/hll/HyperLogLogCollector.java:227-254 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1627— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1627-1654 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTuningConfig.java:381-412 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectBindingVector.java:114— processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectBindingVector.java:114-142 | processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectVector.java:54-81 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:54— processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:54-81 | processing/src/main/java/org/apache/druid/query/topn/Generic2AggPooledTopNScannerPrototype.java:56-88 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:716— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:716-744 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:706-733 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) server/src/main/java/org/apache/druid/discovery/DruidNodeDiscoveryProvider.java:172— server/src/main/java/org/apache/druid/discovery/DruidNodeDiscoveryProvider.java:172-204 | server/src/main/java/org/apache/druid/discovery/DruidNodeDiscoveryProvider.java:208-235 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1000— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1000-1059 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1442-1469 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java:143— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java:143-170 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchMergeAggregatorFactory.java:190-219 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:94— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:94-121 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:168-195 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/query/search/UseIndexesStrategy.java:221— processing/src/main/java/org/apache/druid/query/search/UseIndexesStrategy.java:221-248 | processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorHolder.java:442-474 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java:232— processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java:232-259 | processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java:263-293 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/guava/SkippingSequence.java:55— processing/src/main/java/org/apache/druid/java/util/common/guava/SkippingSequence.java:55-82 | processing/src/main/java/org/apache/druid/query/scan/ScanQueryOffsetSequence.java:66-93 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/MomentSketchModule.java:46— extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/MomentSketchModule.java:46-73 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramModule.java:60-91 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×13
Edited copies of one member (3 members, 13+ corresponding lines) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:131— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:131-143 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:163-175 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java:195-207 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) server/src/main/java/org/apache/druid/server/compaction/ReindexingDeletionRule.java:121— server/src/main/java/org/apache/druid/server/compaction/ReindexingDeletionRule.java:121-134 | server/src/main/java/org/apache/druid/server/compaction/ReindexingIndexSpecRule.java:78-90 | server/src/main/java/org/apache/druid/server/compaction/ReindexingPartitioningRule.java:146-160 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/InvalidFieldFault.java:118— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/InvalidFieldFault.java:118-134 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/InvalidNullByteFault.java:137-153 | processing/src/main/java/org/apache/druid/frame/write/InvalidFieldException.java:85-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:246— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:246-258 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:306-319 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:323-340 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchAggregatorFactory.java:264— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchAggregatorFactory.java:264-279 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java:332-344 | processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java:309-321 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:248— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:248-260 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorFactory.java:448-463 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregatorFactory.java:347-360 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:40— processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:40-52 | processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:63-75 | processing/src/main/java/org/apache/druid/java/util/common/Numbers.java:87-99 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:216— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:216-228 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:216-228 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:216-228 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidAggregateRule.java:60— sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidAggregateRule.java:60-72 | sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidFilterRule.java:48-61 | sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidWindowRule.java:44-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java:50— processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java:50-64 | processing/src/main/java/org/apache/druid/java/util/metrics/CgroupDiskMonitor.java:42-54 | processing/src/main/java/org/apache/druid/java/util/metrics/CgroupMemoryMonitor.java:43-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) processing/src/main/java/org/apache/druid/timeline/IntervalTreeMap.java:532— processing/src/main/java/org/apache/druid/timeline/IntervalTreeMap.java:532-548 | processing/src/main/java/org/apache/druid/timeline/IntervalTreeMap.java:559-575 | processing/src/main/java/org/apache/druid/timeline/IntervalTreeMap.java:586-598 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:589— sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:589-604 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1074-1086 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1193-1205 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchBuildBufferAggregator.java:58— extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchBuildBufferAggregator.java:58-71 | extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMergeBufferAggregator.java:59-72 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingBufferAggregatorHelper.java:64-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×12
Edited copy of a member (33 corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:146— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:146-178 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java:177-213 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:185— processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:185-217 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:225-260 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) processing/src/main/java/org/apache/druid/segment/projections/RollupTableProjectionSchema.java:78— processing/src/main/java/org/apache/druid/segment/projections/RollupTableProjectionSchema.java:78-110 | processing/src/main/java/org/apache/druid/segment/projections/TableProjectionSchema.java:77-109 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/rpc/WorkerResource.java:244— multi-stage-query/src/main/java/org/apache/druid/msq/rpc/WorkerResource.java:244-276 | multi-stage-query/src/main/java/org/apache/druid/msq/rpc/WorkerResource.java:289-322 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:289— multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:289-321 | multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:421-464 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:65— processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:65-103 | processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java:65-97 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/sql/BloomFilterOperatorConversion.java:68— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/sql/BloomFilterOperatorConversion.java:68-115 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ContainsOperatorConversion.java:98-130 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) processing/src/main/java/org/apache/druid/java/util/http/client/response/ObjectOrErrorResponseHandler.java:76— processing/src/main/java/org/apache/druid/java/util/http/client/response/ObjectOrErrorResponseHandler.java:76-112 | processing/src/main/java/org/apache/druid/java/util/http/client/response/ObjectOrErrorResponseHandler.java:118-150 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) quidem-ut/src/main/java/org/apache/druid/quidem/ExposedAsBrokerQueryComponentSupplierWrapper.java:170— quidem-ut/src/main/java/org/apache/druid/quidem/ExposedAsBrokerQueryComponentSupplierWrapper.java:170-202 | server/src/main/java/org/apache/druid/initialization/CoreInjectorBuilder.java:99-143 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/NumericArrayFrameColumnReader.java:303— processing/src/main/java/org/apache/druid/frame/read/columnar/NumericArrayFrameColumnReader.java:303-339 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:349-381 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1142— server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1142-1174 | server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1203-1238 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:176— server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:176-214 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:231-263 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×12
Edited copy of a member (25 corresponding lines) server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:249— server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:249-273 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:330-354 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:774— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:774-798 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1071-1095 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:467— processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:467-492 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:560-584 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java:393— processing/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java:393-417 | processing/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java:454-479 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) sql/src/main/java/org/apache/druid/sql/http/ArrayWriter.java:110— sql/src/main/java/org/apache/druid/sql/http/ArrayWriter.java:110-134 | sql/src/main/java/org/apache/druid/sql/http/CsvWriter.java:71-95 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:313— processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:313-337 | processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:360-388 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) server/src/main/java/org/apache/druid/discovery/BaseNodeRoleWatcher.java:150— server/src/main/java/org/apache/druid/discovery/BaseNodeRoleWatcher.java:150-174 | server/src/main/java/org/apache/druid/discovery/BaseNodeRoleWatcher.java:217-242 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:200— processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:200-224 | processing/src/main/java/org/apache/druid/segment/column/ColumnTypeFactory.java:46-74 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) processing/src/main/java/org/apache/druid/common/config/JacksonConfigManager.java:132— processing/src/main/java/org/apache/druid/common/config/JacksonConfigManager.java:132-156 | processing/src/main/java/org/apache/druid/common/config/JacksonConfigManager.java:160-189 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:238— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:238-263 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:277-301 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/DeltaInputSourceReader.java:68— extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/DeltaInputSourceReader.java:68-92 | processing/src/main/java/org/apache/druid/data/input/IntermediateRowParsingReader.java:123-151 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityParallelIndexTaskRunner.java:70— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityParallelIndexTaskRunner.java:70-95 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionParallelIndexTaskRunner.java:297-321 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (22 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:104— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:104-125 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:87-108 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:86— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:86-107 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java:90-111 — before extracting anything, compare `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskTuningConfig.java:278— extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskTuningConfig.java:278-299 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:301-322 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskTuningConfig.java:278` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:176— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:176-197 | processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:179-200 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:173` calls `getMaxVectorSize` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:176` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:176— processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:176-197 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:174-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:173` calls `getMaxVectorSize` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:171` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:175— processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:175-196 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:185-206 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:172` calls `getMaxVectorSize` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:182` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:213— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:213-234 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:342-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:157— processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:157-178 | processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:264-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:157` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:287— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:287-308 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:229-250 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `ByteBuffer` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (22 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:310— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:310-331 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:214-235 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:310` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:886— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:886-907 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java:145-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:886` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:868— server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:868-889 | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1009-1030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:868` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Change coupling: GroupByQueryKit.java ↔ ScanQueryKit.java multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java:1— `multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java` and `multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryKit.java` change together 91% of the time (10 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `2720cfbd` MSQ: Use MapBinder for QueryKit implementations. (#18875); `b2771293` MSQ: Use leaf worker count for stages that have any leaf inputs. (#17… (at that commit the files were still `extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java` and `extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryKit.java`); `c5968aa4` MSQ: Add QueryKitSpec to encapsulate QueryKit params. (#17077) (at that commit the files were still `extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java` and `extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryKit.java`) — run `git show` on any of them.
Change coupling: DruidCompactionConfig.java ↔ CoordinatorCompactionConfigsResource.java server/src/main/java/org/apache/druid/server/coordinator/DruidCompactionConfig.java:1— `server/src/main/java/org/apache/druid/server/coordinator/DruidCompactionConfig.java` and `server/src/main/java/org/apache/druid/server/http/CoordinatorCompactionConfigsResource.java` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `5fa69bd2` Use compaction dynamic config to enable compaction supervisors (#17782); `f576e299` Allow MSQ engine only for compaction supervisors (#17033); `954aaafe` Refactor: Clean up compaction config classes (#16810) — run `git show` on any of them.
Change coupling: CliIndexerServerModule.java ↔ JettyServerModule.java server/src/main/java/org/apache/druid/server/initialization/jetty/CliIndexerServerModule.java:1— `server/src/main/java/org/apache/druid/server/initialization/jetty/CliIndexerServerModule.java` and `server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `697dfcce` minor: `unannouncePropagationDelay` should be ignored for tasks which…; `5e710568` feat(server): add response identity headers (#20268); `713be4a4` Add QOS filtering of overlord requests (#18033) — run `git show` on any of them.
Change coupling: KinesisSupervisor.java ↔ KinesisSupervisorTuningConfig.java extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisor.java:1— `extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisor.java` and `extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `9d4e8053` Kinesis adaptive memory management (#15360); `182c4fad` Kinesis: More robust default fetch settings. (#13539); `9cbda66d` Remove skip ignorable shards (#13221) — run `git show` on any of them.
Change coupling: services-view.tsx ↔ tasks-view.tsx web-console/src/views/services-view/services-view.tsx:1— `web-console/src/views/services-view/services-view.tsx` and `web-console/src/views/tasks-view/tasks-view.tsx` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `841faf15` feat: web console: add file uri tooltip to sample data view (#19741); `86aa0580` Web console: explicitly set engine: 'native' for system table queries…; `42c7b062` Display time in local time (#18455) — run `git show` on any of them.
Change coupling: supervisors-view.tsx ↔ tasks-view.tsx web-console/src/views/supervisors-view/supervisors-view.tsx:1— `web-console/src/views/supervisors-view/supervisors-view.tsx` and `web-console/src/views/tasks-view/tasks-view.tsx` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `841faf15` feat: web console: add file uri tooltip to sample data view (#19741); `6a2c29d8` Web console: load Dart reports (#18897); `86aa0580` Web console: explicitly set engine: 'native' for system table queries… — run `git show` on any of them.
Change coupling: lookups-view.tsx ↔ services-view.tsx web-console/src/views/lookups-view/lookups-view.tsx:1— `web-console/src/views/lookups-view/lookups-view.tsx` and `web-console/src/views/services-view/services-view.tsx` change together 55% of the time (16 of the 29 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `8232fb51` Web console: fix supervisor actions menu not working well with lots o…; `d320e09a` Web console: show loader on aux queries (#17804); `44b3f8e5` Web console: fix a few console bugs (#16735) — run `git show` on any of them.
Change coupling: DruidCoordinator.java ↔ ServerHolder.java server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java:1— `server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java` and `server/src/main/java/org/apache/druid/server/coordinator/ServerHolder.java` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `cefac476` Add coordinator dynamic config `cloneServers` to clone an existing hi…; `5d4ac641` Adapt maxSegmentsToMove based on cluster skew (#14584); `71b133f3` Add `RoundRobinServerSelector` to speed up segment assignments (#13367) — run `git show` on any of them.
Change coupling: GroupByQueryEngine.java ↔ VectorGroupByEngine.java processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java:1— `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java` and `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/VectorGroupByEngine.java` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `dca31d46` minor adjustments for performance (#16714); `2118258b` tidy up group by engines after removal of v1 (#15665); `97207cdc` Automatic sizing for GroupBy dictionaries. (#12763) (at that commit the file was still `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngineV2.java`) — run `git show` on any of them.
Change coupling: VectorGroupByEngine.java ↔ TimeseriesQueryEngine.java processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/VectorGroupByEngine.java:1— `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/VectorGroupByEngine.java` and `processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryEngine.java` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `dca31d46` minor adjustments for performance (#16714); `2dd073c2` Pass metrics object for Scan, Timeseries and GroupBy queries during c…; `1d6cb624` add vectorizeVirtualColumns query context parameter (#10432) — run `git show` on any of them.
Change coupling: StringDimensionIndexer.java ↔ StringDimensionMergerV9.java processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:1— `processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java` and `processing/src/main/java/org/apache/druid/segment/StringDimensionMergerV9.java` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `953b505d` refactor: add ColumnFormat implementation for string columns (#19410); `02b20573` extract generic dictionary encoded column indexing and merging stuffs…; `e4eaee38` Support for disabling bitmap indexes. (#5402) (at that commit the files were still `processing/src/main/java/io/druid/segment/StringDimensionIndexer.java` and `processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java`) — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×11
Edited copy of a member (32 corresponding lines) processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java:87— processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java:87-121 | processing/src/main/java/org/apache/druid/java/util/metrics/CgroupV2CpuMonitor.java:63-94 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlInsert.java:114— sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlInsert.java:114-145 | sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlReplace.java:130-172 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryModule.java:64— extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryModule.java:64-95 | extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDiscoveryModule.java:61-105 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:364— server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:364-395 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:502-540 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTimestampVersionedDataFinder.java:57— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTimestampVersionedDataFinder.java:57-88 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TimestampVersionedDataFinder.java:59-94 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java:419— indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java:419-453 | indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java:542-573 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) processing/src/main/java/org/apache/druid/data/input/impl/JsonNodeReader.java:96— processing/src/main/java/org/apache/druid/data/input/impl/JsonNodeReader.java:96-132 | processing/src/main/java/org/apache/druid/data/input/impl/JsonReader.java:121-152 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarMultiIntsSupplier.java:114— processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarMultiIntsSupplier.java:114-147 | processing/src/main/java/org/apache/druid/segment/data/V3CompressedVSizeColumnarMultiIntsSupplier.java:92-123 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/TimeFormatOperatorConversion.java:66— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/TimeFormatOperatorConversion.java:66-104 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/TimeParseOperatorConversion.java:63-94 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:992— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:992-1023 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:1033-1068 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:123— processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:123-154 | processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:163-194 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×11
Edited copy of a member (29 corresponding lines) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:136— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:136-165 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:164-192 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:635— processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:635-663 | processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:682-711 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1291— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1291-1328 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:334-362 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) processing/src/main/java/org/apache/druid/java/util/emitter/core/LoggingEmitter.java:152— processing/src/main/java/org/apache/druid/java/util/emitter/core/LoggingEmitter.java:152-180 | processing/src/main/java/org/apache/druid/java/util/emitter/core/LoggingEmitter.java:239-267 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:298— processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:298-326 | processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:289-320 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:139— processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:139-168 | processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:192-220 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) processing/src/main/java/org/apache/druid/query/dimension/PredicateFilteredDimensionSelector.java:68— processing/src/main/java/org/apache/druid/query/dimension/PredicateFilteredDimensionSelector.java:68-100 | processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:132-160 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java:107— sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java:107-135 | sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java:145-176 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:77— processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:77-105 | processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:83-112 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:48— processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:48-76 | processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java:65-93 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:898— multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:898-927 | multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1037-1065 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×11
Edited copies of one member (3 members, 14+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/filtration/Bounds.java:76— sql/src/main/java/org/apache/druid/sql/calcite/filtration/Bounds.java:76-89 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/Ranges.java:76-93 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/Ranges.java:96-114 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1589— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1589-1603 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1609-1622 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1631-1644 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:350— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:350-364 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:371-384 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:391-404 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/FrameReaderUtils.java:203— processing/src/main/java/org/apache/druid/frame/read/FrameReaderUtils.java:203-216 | processing/src/main/java/org/apache/druid/frame/read/FrameReaderUtils.java:229-242 | processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:128-141 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:136— processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:136-149 | processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:156-169 | processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java:176-189 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5644— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5644-5658 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5661-5674 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5677-5694 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableColumnValueSelector.java:44— processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableColumnValueSelector.java:44-57 | processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableColumnValueSelector.java:61-74 | processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableColumnValueSelector.java:78-91 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java:105— processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java:105-118 | processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java:121-134 | processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java:137-150 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/NumericArrayFrameColumnReader.java:90— processing/src/main/java/org/apache/druid/frame/read/columnar/NumericArrayFrameColumnReader.java:90-103 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:113-128 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:134-149 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:43— processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:43-56 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:43-58 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:43-57 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/OperatorConversions.java:142— sql/src/main/java/org/apache/druid/sql/calcite/expression/OperatorConversions.java:142-156 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/TimeCeilOperatorConversion.java:62-75 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/TimeFloorOperatorConversion.java:202-219 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×11
Edited copies of one member (3 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:199— processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:199-215 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:239-255 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:587-602 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:648— processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:648-663 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:667-682 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:686-702 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/ObjectColumnDoubleBufferAggregatorWrapper.java:54— processing/src/main/java/org/apache/druid/query/aggregation/ObjectColumnDoubleBufferAggregatorWrapper.java:54-69 | processing/src/main/java/org/apache/druid/query/aggregation/ObjectColumnFloatBufferAggregatorWrapper.java:54-69 | processing/src/main/java/org/apache/druid/query/aggregation/ObjectColumnLongBufferAggregatorWrapper.java:54-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/ObjectColumnDoubleAggregatorWrapper.java:53— processing/src/main/java/org/apache/druid/query/aggregation/ObjectColumnDoubleAggregatorWrapper.java:53-68 | processing/src/main/java/org/apache/druid/query/aggregation/ObjectColumnFloatAggregatorWrapper.java:53-68 | processing/src/main/java/org/apache/druid/query/aggregation/ObjectColumnLongAggregatorWrapper.java:53-68 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:118— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:118-133 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToCDFPostAggregator.java:118-133 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToCDFPostAggregator.java:118-133 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureSegmentRangeReader.java:67— extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureSegmentRangeReader.java:67-82 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleSegmentRangeReader.java:58-73 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SegmentRangeReader.java:62-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:71— processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:71-86 | processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:137-152 | processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:240-255 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:160— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:160-177 | processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:278-293 | processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplierV4.java:255-272 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1341— server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1341-1362 | server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1369-1393 | server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1399-1414 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerde.java:99— processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerde.java:99-115 | processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerde.java:99-114 | processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerde.java:99-114 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomDimFilter.java:106— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomDimFilter.java:106-121 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomDimFilter.java:125-140 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomDimFilter.java:144-159 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×11
Edited copies of one member (3 members, 10+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTaskUtils.java:42— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTaskUtils.java:42-51 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTaskUtils.java:54-64 | multi-stage-query/src/main/java/org/apache/druid/msq/exec/MSQMetricEventBuilder.java:72-88 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/DeepStoragePartitionLocation.java:92— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/DeepStoragePartitionLocation.java:92-104 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/DeepStoragePartitionStat.java:90-99 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/GenericPartitionLocation.java:128-142 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/RetrieveSegmentsByIdAction.java:77— indexing-service/src/main/java/org/apache/druid/indexing/common/actions/RetrieveSegmentsByIdAction.java:77-86 | multi-stage-query/src/main/java/org/apache/druid/msq/input/table/SegmentsInputSlice.java:91-102 | server/src/main/java/org/apache/druid/segment/metadata/DataSourceInformation.java:60-72 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/messages/PostCounters.java:79— multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/messages/PostCounters.java:79-90 | multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/messages/WorkerError.java:70-80 | multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/messages/WorkerWarning.java:71-80 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/query/FilteredDataSource.java:172— processing/src/main/java/org/apache/druid/query/FilteredDataSource.java:172-181 | processing/src/main/java/org/apache/druid/query/ProjectDataSource.java:151-160 | processing/src/main/java/org/apache/druid/query/RestrictedDataSource.java:202-211 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:150— processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:150-161 | processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java:177-188 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemQueryContextParametersTable.java:277-286 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleColumnSerializer.java:41— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleColumnSerializer.java:41-50 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatColumnSerializer.java:41-50 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongColumnSerializer.java:41-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:106— processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:106-115 | processing/src/main/java/org/apache/druid/frame/write/columnar/FloatFrameMaker.java:106-115 | processing/src/main/java/org/apache/druid/frame/write/columnar/LongFrameMaker.java:106-115 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/SuppressedAggregatorFactory.java:182— processing/src/main/java/org/apache/druid/query/aggregation/SuppressedAggregatorFactory.java:182-191 | processing/src/main/java/org/apache/druid/query/aggregation/SuppressedAggregatorFactory.java:268-277 | processing/src/main/java/org/apache/druid/query/aggregation/SuppressedAggregatorFactory.java:372-381 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) server/src/main/java/org/apache/druid/segment/loading/OmniDataSegmentArchiver.java:63— server/src/main/java/org/apache/druid/segment/loading/OmniDataSegmentArchiver.java:63-72 | server/src/main/java/org/apache/druid/segment/loading/OmniDataSegmentKiller.java:83-95 | server/src/main/java/org/apache/druid/segment/loading/OmniDataSegmentMover.java:57-66 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumVectorAggregator.java:44— processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumVectorAggregator.java:44-53 | processing/src/main/java/org/apache/druid/query/aggregation/FloatSumVectorAggregator.java:44-53 | processing/src/main/java/org/apache/druid/query/aggregation/LongSumVectorAggregator.java:44-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×11
Edited copy of a member (4 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:261— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:261-264 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregatorFactory.java:228-231 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstBufferAggregator.java:55— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstBufferAggregator.java:55-58 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastBufferAggregator.java:55-58 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) processing/src/main/java/org/apache/druid/java/util/metrics/ProcFsReader.java:45— processing/src/main/java/org/apache/druid/java/util/metrics/ProcFsReader.java:45-48 | processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/ProcCgroupDiscoverer.java:52-55 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) processing/src/main/java/org/apache/druid/segment/RemapColumnSelectorFactory.java:42— processing/src/main/java/org/apache/druid/segment/RemapColumnSelectorFactory.java:42-45 | processing/src/main/java/org/apache/druid/segment/vector/RemapVectorColumnSelectorFactory.java:56-59 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:394— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:394-397 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTask.java:526-529 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1928— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1928-1932 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTask.java:547-550 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/guava/SkippingSequence.java:46— processing/src/main/java/org/apache/druid/java/util/common/guava/SkippingSequence.java:46-49 | processing/src/main/java/org/apache/druid/query/scan/ScanQueryOffsetSequence.java:57-60 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) server/src/main/java/org/apache/druid/client/DruidServer.java:262— server/src/main/java/org/apache/druid/client/DruidServer.java:262-265 | server/src/main/java/org/apache/druid/client/ImmutableDruidServer.java:132-135 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) processing/src/main/java/org/apache/druid/query/extraction/LowerExtractionFn.java:40— processing/src/main/java/org/apache/druid/query/extraction/LowerExtractionFn.java:40-43 | processing/src/main/java/org/apache/druid/query/extraction/UpperExtractionFn.java:40-43 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) processing/src/main/java/org/apache/druid/segment/BaseSingleValueDimensionSelector.java:64— processing/src/main/java/org/apache/druid/segment/BaseSingleValueDimensionSelector.java:64-67 | processing/src/main/java/org/apache/druid/segment/SingleScanTimeDimensionSelector.java:88-91 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergArrowInputSourceReader.java:206— extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergArrowInputSourceReader.java:206-209 | indexing-service/src/main/java/org/apache/druid/indexing/input/GeneratorInputSource.java:207-211 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (5 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchBuildVectorAggregator.java:74— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchBuildVectorAggregator.java:74-78 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregator.java:74-78 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java:74-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchBuildVectorAggregator.java:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java:70` calls `position`, `limit` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregator.java:73` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUser.java:68— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUser.java:68-72 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUserFull.java:72-76 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUserFullSimplifiedPermissions.java:68-72 — before extracting anything, compare `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUser.java` and `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUserFull.java` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUser.java:68` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:60— processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:60-64 | processing/src/main/java/org/apache/druid/query/topn/Generic2AggPooledTopNScannerPrototype.java:63-67 | processing/src/main/java/org/apache/druid/query/topn/Historical1SimpleDoubleAggPooledTopNScannerPrototype.java:69-73 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java` and `processing/src/main/java/org/apache/druid/query/topn/Generic2AggPooledTopNScannerPrototype.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/query/topn/Generic2AggPooledTopNScannerPrototype.java:69` calls `aggregate` and `processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:66` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:51— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:51-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToCDFPostAggregator.java:51-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToCDFPostAggregator.java:51-55 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToCDFPostAggregator.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `splitPoints` to `double[]` in one and `float[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:137— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:137-141 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToCDFPostAggregator.java:137-141 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToCDFPostAggregator.java:137-141 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToCDFPostAggregator.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToRankPostAggregator.java:51— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToRankPostAggregator.java:51-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToRankPostAggregator.java:51-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToRankPostAggregator.java:51-55 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToRankPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToRankPostAggregator.java` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `double` in one and `float` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 3) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUser.java:76— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUser.java:76-80 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUserFull.java:80-84 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUserFullSimplifiedPermissions.java:76-80 — before extracting anything, compare `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUser.java` and `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUserFull.java` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:53— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:53-57 | processing/src/main/java/org/apache/druid/segment/data/ColumnarInts.java:32-36 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:53-57 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `out` to `double[]` in one and `int[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java:97— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java:97-102 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FloatFirstLastVectorAggregator.java:97-101 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/SingleStringFirstLastDimensionVectorAggregator.java:104-108 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FloatFirstLastVectorAggregator.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:143— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:143-147 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:138-142 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:149-153 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableDoubleGroupByVectorColumnSelector.java:53— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableDoubleGroupByVectorColumnSelector.java:53-57 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableFloatGroupByVectorColumnSelector.java:53-57 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableLongGroupByVectorColumnSelector.java:53-57 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableDoubleGroupByVectorColumnSelector.java` and `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableFloatGroupByVectorColumnSelector.java` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableDoubleGroupByVectorColumnSelector.java:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×10
Edited copy of a member (31 corresponding lines) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:2727— server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:2727-2757 | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:2764-2804 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQCompactionRunner.java:161— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQCompactionRunner.java:161-206 | server/src/main/java/org/apache/druid/client/indexing/ClientCompactionRunnerInfo.java:126-156 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:859— processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:859-889 | processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:933-966 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:238— processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:238-268 | processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:392-429 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:300— indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:300-330 | indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:356-389 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java:171— extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java:171-201 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentPusher.java:164-194 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:98— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:98-128 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java:101-132 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Parser.java:230— processing/src/main/java/org/apache/druid/math/expr/Parser.java:230-260 | processing/src/main/java/org/apache/druid/math/expr/Parser.java:286-316 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:429— indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:429-460 | indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:477-507 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) processing/src/main/java/org/apache/druid/query/dimension/PredicateFilteredDimensionSelector.java:104— processing/src/main/java/org/apache/druid/query/dimension/PredicateFilteredDimensionSelector.java:104-135 | processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:234-264 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×10
Edited copy of a member (30 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:159— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:159-188 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java:209-239 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:72— processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:72-101 | processing/src/main/java/org/apache/druid/java/util/common/concurrent/ScheduledExecutors.java:152-183 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPusher.java:64— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPusher.java:64-96 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPusher.java:94-123 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) server/src/main/java/org/apache/druid/client/selector/CustomTierSelectorStrategy.java:43— server/src/main/java/org/apache/druid/client/selector/CustomTierSelectorStrategy.java:43-73 | server/src/main/java/org/apache/druid/client/selector/StrictTierSelectorStrategy.java:80-109 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarFloatsSupplier.java:101— processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarFloatsSupplier.java:101-130 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarLongsSupplier.java:116-152 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPuller.java:79— extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPuller.java:79-112 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentPuller.java:57-86 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/DartWorkerContext.java:251— multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/DartWorkerContext.java:251-285 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerWorkerContext.java:329-358 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:561— server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:561-590 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java:620-653 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceSerde.java:48— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceSerde.java:48-77 | processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesSerde.java:60-91 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:130— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:130-159 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentMover.java:152-183 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×10
Edited copies of one member (4 members, 13+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:393— processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:393-407 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:449-461 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:465-479 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:483-495 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:41— processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:41-53 | processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedDoubleVectorProcessor.java:57-69 | processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedLongVectorProcessor.java:41-53 | processing/src/main/java/org/apache/druid/math/expr/vector/CaseSearchedLongVectorProcessor.java:57-69 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/DoubleGroupByVectorColumnSelector.java:50— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/DoubleGroupByVectorColumnSelector.java:50-62 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/FloatGroupByVectorColumnSelector.java:50-62 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/LongGroupByVectorColumnSelector.java:50-62 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/SingleValueStringGroupByVectorColumnSelector.java:56-68 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1668— indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1668-1680 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1684-1696 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1700-1712 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1732-1744 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMaxPostAggregator.java:104— extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMaxPostAggregator.java:104-116 | extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchMinPostAggregator.java:103-115 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/teststats/PvaluefromZscorePostAggregator.java:136-151 | server/src/main/java/org/apache/druid/server/security/Resource.java:58-73 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:371— server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:371-383 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:407-420 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:424-436 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:460-473 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchAggregatorFactory.java:284— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchAggregatorFactory.java:284-299 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorFactory.java:430-444 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregatorFactory.java:272-284 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregatorFactory.java:313-331 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:160— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:160-172 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:176-188 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregatorFactory.java:124-136 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregatorFactory.java:140-152 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) server/src/main/java/org/apache/druid/segment/realtime/ChatHandlers.java:46— server/src/main/java/org/apache/druid/segment/realtime/ChatHandlers.java:46-58 | server/src/main/java/org/apache/druid/server/http/security/ConfigResourceFilter.java:53-70 | server/src/main/java/org/apache/druid/server/http/security/DatasourceResourceFilter.java:54-71 | server/src/main/java/org/apache/druid/server/http/security/StateResourceFilter.java:57-74 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/CompressedBigDecimalBufferAggregatorBase.java:72— extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/CompressedBigDecimalBufferAggregatorBase.java:72-91 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxBufferAggregator.java:65-84 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/min/CompressedBigDecimalMinBufferAggregator.java:66-85 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/sum/CompressedBigDecimalSumBufferAggregator.java:61-73 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×10
Edited copies of one member (3 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Function.java:3124— processing/src/main/java/org/apache/druid/math/expr/Function.java:3124-3135 | processing/src/main/java/org/apache/druid/math/expr/Function.java:3161-3172 | processing/src/main/java/org/apache/druid/query/expression/RegexpReplaceExprMacro.java:136-148 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyAggregatorFactory.java:214— processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyAggregatorFactory.java:214-225 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:343-355 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregatorFactory.java:310-322 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:266— processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:266-278 | processing/src/main/java/org/apache/druid/segment/virtual/PrefixFilteredVirtualColumn.java:149-160 | processing/src/main/java/org/apache/druid/segment/virtual/RegexFilteredVirtualColumn.java:149-160 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:472— processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:472-483 | processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:486-497 | processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:500-511 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchMergeVectorAggregator.java:52— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchMergeVectorAggregator.java:52-63 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchMergeVectorAggregator.java:52-63 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchMergeVectorAggregator.java:53-64 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java:230— processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java:230-241 | processing/src/main/java/org/apache/druid/query/aggregation/any/FloatAnyAggregatorFactory.java:228-239 | processing/src/main/java/org/apache/druid/query/aggregation/any/LongAnyAggregatorFactory.java:227-238 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:241— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:241-252 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:303-314 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:317-328 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregateCombiner.java:55— extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregateCombiner.java:55-66 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/min/CompressedBigDecimalMinAggregateCombiner.java:55-66 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/sum/CompressedBigDecimalSumAggregateCombiner.java:55-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/guava/ParallelMergeCombiningSequence.java:329— processing/src/main/java/org/apache/druid/java/util/common/guava/ParallelMergeCombiningSequence.java:329-343 | processing/src/main/java/org/apache/druid/java/util/common/guava/ParallelMergeCombiningSequence.java:557-568 | processing/src/main/java/org/apache/druid/java/util/common/guava/ParallelMergeCombiningSequence.java:751-762 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:504— processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:504-515 | sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:154-165 | sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:186-202 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (19 lines × 2) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:269— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:269-287 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java:177-195 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:249— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:249-267 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:247-265 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryStageProcessor.java:124— multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryStageProcessor.java:124-142 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/results/QueryResultStageProcessor.java:75-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryStageProcessor.java:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) processing/src/main/java/org/apache/druid/common/config/JacksonConfigManager.java:133— processing/src/main/java/org/apache/druid/common/config/JacksonConfigManager.java:133-151 | processing/src/main/java/org/apache/druid/common/config/JacksonConfigManager.java:161-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/common/config/JacksonConfigManager.java:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:225— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:225-243 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:261-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouper.java:225` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/ColumnBasedFrameRowsAndColumns.java:42— processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/ColumnBasedFrameRowsAndColumns.java:42-60 | processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/RowBasedFrameRowsAndColumns.java:43-61 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/ColumnBasedFrameRowsAndColumns.java` and `processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/RowBasedFrameRowsAndColumns.java` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/ColumnBasedFrameRowsAndColumns.java:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) processing/src/main/java/org/apache/druid/segment/join/filter/JoinFilterAnalyzer.java:308— processing/src/main/java/org/apache/druid/segment/join/filter/JoinFilterAnalyzer.java:308-326 | processing/src/main/java/org/apache/druid/segment/join/filter/JoinFilterAnalyzer.java:482-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/join/filter/JoinFilterAnalyzer.java:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:271— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:271-289 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:271-289 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:834— processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:834-852 | processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:879-897 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:834` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnV3.java:54— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnV3.java:54-72 | processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnV4.java:54-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 3) extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java:53— extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java:53-63 | extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageDruidModule.java:93-103 | extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/ParquetInputFormat.java:65-75 — before extracting anything, compare `extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java` and `extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageDruidModule.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:904— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:904-914 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1001-1011 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1443-1453 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java:218— processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java:218-228 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java:205-215 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleLongAggregatorFactory.java:208-218 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java:218` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouper.java:304— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouper.java:304-314 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouper.java:323-333 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouper.java:474-484 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouper.java:304` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:194— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:194-204 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:189-199 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:200-210 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:639— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:639-649 | processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:754-764 | processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:834-844 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:639` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java:87— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java:87-97 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java:87-97 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregator.java:87-97 — before extracting anything, compare `extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java` and `extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskRunner.java:140— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskRunner.java:140-150 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskRunner.java:245-255 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskRunner.java:186-196 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (11 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchMergeAggregator.java:39— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchMergeAggregator.java:39-49 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchMergeAggregator.java:39-49 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchMergeAggregator.java:74-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `union` to `KllDoublesSketch` in one and `KllFloatsSketch` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 3) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:116— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:116-126 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java:108-118 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:292-302 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java` and `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
AC4 · Keyboard semantics· Anchor without href · ×9
Anchor without href web-console/src/components/click-to-copy/click-to-copy.tsx:32— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web-console/src/components/query-error-pane/query-error-pane.tsx:50— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web-console/src/components/query-error-pane/query-error-pane.tsx:92— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web-console/src/components/query-error-pane/query-error-pane.tsx:99— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:243— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:247— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web-console/src/views/workbench-view/execution-error-pane/execution-error-pane.tsx:59— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web-console/src/views/workbench-view/execution-error-pane/execution-error-pane.tsx:82— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web-console/src/views/workbench-view/input-source-step/input-source-step.tsx:293— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×9
Edited copy of a member (37 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:261— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:261-297 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:306-346 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:259— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:259-295 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:259-295 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2AutoScaler.java:260— extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2AutoScaler.java:260-296 | extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2AutoScaler.java:300-336 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) processing/src/main/java/org/apache/druid/segment/IndexIO.java:1122— processing/src/main/java/org/apache/druid/segment/IndexIO.java:1122-1158 | processing/src/main/java/org/apache/druid/segment/IndexIO.java:1175-1213 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentMetadataUpdateAction.java:64— indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentMetadataUpdateAction.java:64-100 | indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentNukeAction.java:73-113 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/MultiValueStringOperatorConversions.java:559— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/MultiValueStringOperatorConversions.java:559-595 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/MultiValueStringOperatorConversions.java:628-665 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureInputSource.java:136— extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureInputSource.java:136-172 | extensions-core/azure-extensions/src/main/java/org/apache/druid/data/input/azure/AzureStorageAccountInputSource.java:153-191 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:292— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:292-331 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:199-235 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/IPv4AddressParseExprMacro.java:61— processing/src/main/java/org/apache/druid/query/expression/IPv4AddressParseExprMacro.java:61-97 | processing/src/main/java/org/apache/druid/query/expression/IPv4AddressStringifyExprMacro.java:60-96 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×9
Edited copy of a member (24 corresponding lines) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java:72— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java:72-101 | extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:181-204 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java:128— processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java:128-151 | processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java:179-210 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/types/StringTopNColumnAggregatesProcessor.java:151— processing/src/main/java/org/apache/druid/query/topn/types/StringTopNColumnAggregatesProcessor.java:151-179 | processing/src/main/java/org/apache/druid/query/topn/types/StringTopNColumnAggregatesProcessor.java:195-218 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerTableInputSpecSlicer.java:102— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerTableInputSpecSlicer.java:102-125 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerTableInputSpecSlicer.java:135-161 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) server/src/main/java/org/apache/druid/server/http/CoordinatorBrokerConfigsResource.java:87— server/src/main/java/org/apache/druid/server/http/CoordinatorBrokerConfigsResource.java:87-112 | server/src/main/java/org/apache/druid/server/http/CoordinatorDynamicConfigsResource.java:87-110 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/guava/WrappingSequence.java:41— processing/src/main/java/org/apache/druid/java/util/common/guava/WrappingSequence.java:41-73 | processing/src/main/java/org/apache/druid/java/util/common/guava/WrappingSequence.java:80-103 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcher.java:225— extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcher.java:225-248 | server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:986-1011 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergArrowInputSourceReader.java:194— extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergArrowInputSourceReader.java:194-217 | processing/src/main/java/org/apache/druid/java/util/common/parsers/CloseableIterator.java:34-60 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) server/src/main/java/org/apache/druid/server/security/AllowAllAuthenticator.java:70— server/src/main/java/org/apache/druid/server/security/AllowAllAuthenticator.java:70-93 | server/src/main/java/org/apache/druid/server/security/AnonymousAuthenticator.java:87-110 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×9
Edited copy of a member (26 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:167— processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:167-192 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:205-230 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:944— sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:944-969 | sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:977-1002 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java:627— server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java:627-657 | server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java:661-686 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:406— server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:406-431 | server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java:455-480 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/exec/MemoryIntrospectorImpl.java:144— multi-stage-query/src/main/java/org/apache/druid/msq/exec/MemoryIntrospectorImpl.java:144-169 | server/src/main/java/org/apache/druid/server/SubqueryGuardrailHelper.java:131-159 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/ColumnBasedFrameRowsAndColumns.java:41— processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/ColumnBasedFrameRowsAndColumns.java:41-66 | processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/RowBasedFrameRowsAndColumns.java:42-68 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregator.java:59— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregator.java:59-84 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregator.java:59-84 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/filtration/Bounds.java:44— sql/src/main/java/org/apache/druid/sql/calcite/filtration/Bounds.java:44-73 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/Ranges.java:48-73 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesStorageDruidModule.java:53— extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesStorageDruidModule.java:53-78 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleStorageDruidModule.java:53-82 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×9
Edited copies of one member (3 members, 11+ corresponding lines) extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/GenericAvroJsonProvider.java:70— extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/GenericAvroJsonProvider.java:70-80 | extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcStructJsonProvider.java:56-66 | extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupJsonProvider.java:71-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:385— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:385-398 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:868-878 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:894-904 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:101— extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:101-113 | extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:134-144 | extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:158-168 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/FrameReader.java:186— processing/src/main/java/org/apache/druid/frame/read/FrameReader.java:186-196 | processing/src/main/java/org/apache/druid/frame/read/FrameReader.java:202-212 | processing/src/main/java/org/apache/druid/segment/join/table/FrameBasedIndexedTable.java:281-294 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) server/src/main/java/org/apache/druid/query/lookup/LookupListeningResource.java:235— server/src/main/java/org/apache/druid/query/lookup/LookupListeningResource.java:235-250 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:795-805 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:812-822 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleByteSource.java:64— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleByteSource.java:64-74 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleInputRange.java:61-73 | processing/src/main/java/org/apache/druid/data/input/impl/CloudObjectLocation.java:119-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:724— processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:724-734 | processing/src/main/java/org/apache/druid/query/filter/LikeDimFilter.java:473-483 | processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java:389-399 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) server/src/main/java/org/apache/druid/client/BrokerServerView.java:415— server/src/main/java/org/apache/druid/client/BrokerServerView.java:415-425 | server/src/main/java/org/apache/druid/client/CoordinatorServerView.java:272-282 | server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java:359-369 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/messages/DoneReadingInput.java:75— multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/messages/DoneReadingInput.java:75-85 | multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/messages/PartialKeyStatistics.java:90-101 | multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/messages/ResultsComplete.java:90-101 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×9
Edited copies of one member (3 members, 8+ corresponding lines) server/src/main/java/org/apache/druid/segment/loading/OmniDataSegmentArchiver.java:41— server/src/main/java/org/apache/druid/segment/loading/OmniDataSegmentArchiver.java:41-48 | server/src/main/java/org/apache/druid/segment/loading/OmniDataSegmentKiller.java:47-54 | server/src/main/java/org/apache/druid/segment/loading/OmniDataSegmentMover.java:41-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumVectorAggregator.java:63— processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumVectorAggregator.java:63-70 | processing/src/main/java/org/apache/druid/query/aggregation/FloatSumVectorAggregator.java:64-71 | processing/src/main/java/org/apache/druid/query/aggregation/LongSumVectorAggregator.java:63-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:106— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:106-113 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:106-113 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:106-113 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/query/search/SearchQueryRunner.java:158— processing/src/main/java/org/apache/druid/query/search/SearchQueryRunner.java:158-165 | processing/src/main/java/org/apache/druid/query/search/SearchQueryRunner.java:179-186 | processing/src/main/java/org/apache/druid/query/search/SearchQueryRunner.java:200-207 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:113— extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:113-120 | extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:124-131 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregatorFactory.java:108-119 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyVectorAggregator.java:44— processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyVectorAggregator.java:44-51 | processing/src/main/java/org/apache/druid/query/aggregation/any/FloatAnyVectorAggregator.java:44-51 | processing/src/main/java/org/apache/druid/query/aggregation/any/LongAnyVectorAggregator.java:45-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/segment/LongColumnSerializer.java:65— processing/src/main/java/org/apache/druid/segment/LongColumnSerializer.java:65-72 | processing/src/main/java/org/apache/druid/segment/LongColumnSerializerV2.java:89-97 | processing/src/main/java/org/apache/druid/segment/data/IntermediateColumnarLongsSerializer.java:71-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) server/src/main/java/org/apache/druid/server/compaction/ReindexingDeletionRule.java:150— server/src/main/java/org/apache/druid/server/compaction/ReindexingDeletionRule.java:150-158 | server/src/main/java/org/apache/druid/server/compaction/ReindexingIndexSpecRule.java:105-112 | server/src/main/java/org/apache/druid/server/compaction/ReindexingPartitioningRule.java:177-186 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:198— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:198-205 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java:190-197 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarLongsSupplier.java:240-248 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (23 lines × 2) extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java:49— extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java:49-71 | extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageDruidModule.java:89-111 — before extracting anything, compare `extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java` and `extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageDruidModule.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) processing/src/main/java/org/apache/druid/query/scan/SettableCursorColumnSelectorFactory.java:82— processing/src/main/java/org/apache/druid/query/scan/SettableCursorColumnSelectorFactory.java:82-104 | processing/src/main/java/org/apache/druid/query/scan/SettableCursorColumnSelectorFactory.java:109-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:119— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:119-141 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:128-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:894— server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:894-916 | server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:316-338 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:894` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:167— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:167-189 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayOverlapOperatorConversion.java:178-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/QueryKitUtils.java:170— multi-stage-query/src/main/java/org/apache/druid/msq/querykit/QueryKitUtils.java:170-192 | processing/src/main/java/org/apache/druid/frame/write/FrameWriters.java:101-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23 lines × 2) processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:184— processing/src/main/java/org/apache/druid/query/filter/ArrayContainsElementFilter.java:184-206 | processing/src/main/java/org/apache/druid/query/filter/EqualityFilter.java:181-203 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (23 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:220— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:220-242 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:220-242 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5763— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5763-5768 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5771-5776 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5779-5784 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:5763` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:878— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:878-883 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1360-1365 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1522-1527 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java:217— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java:217-222 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:306-311 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:306-311 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java:217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:915— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:915-920 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:970-975 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:1029-1034 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:915` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:228— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:228-233 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:414-419 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:708-713 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) processing/src/main/java/org/apache/druid/query/topn/TimeExtractionTopNAlgorithm.java:126— processing/src/main/java/org/apache/druid/query/topn/TimeExtractionTopNAlgorithm.java:126-131 | processing/src/main/java/org/apache/druid/query/topn/types/NullableNumericTopNColumnAggregatesProcessor.java:124-129 | processing/src/main/java/org/apache/druid/query/topn/types/StringTopNColumnAggregatesProcessor.java:88-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/topn/TimeExtractionTopNAlgorithm.java:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/NotEnoughMemoryFault.java:136— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/NotEnoughMemoryFault.java:136-141 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/NotEnoughTemporaryStorageFault.java:69-74 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TaskStartTimeoutFault.java:83-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:162— processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:162-167 | processing/src/main/java/org/apache/druid/segment/virtual/PrefixFilteredVirtualColumn.java:115-121 | processing/src/main/java/org/apache/druid/segment/virtual/RegexFilteredVirtualColumn.java:115-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Outbound HTTP without resilience REDACTED:245— `HttpClients.custom(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience extensions-core/druid-pac4j/src/main/java/org/apache/druid/security/pac4j/CustomSSLResourceRetriever.java:52— `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/httpclient/jdk/DruidKubernetesJdkHttpClientFactory.java:54— `HttpClient.newBuilder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/FileBasedProtobufBytesDecoder.java:77— `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience processing/src/main/java/org/apache/druid/data/input/impl/HttpEntity.java:91— `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience processing/src/main/java/org/apache/druid/java/util/http/client/AbstractHttpClient.java:25— `HttpClient` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience processing/src/main/java/org/apache/druid/java/util/http/client/HttpClient.java:29— `HttpClient` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:66— `HttpClients.createDefault(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
HackComment web-console/src/utils/sampler.ts:540— // Hack Hack Hack — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment web-console/src/utils/sampler.ts:608— // Hack Hack Hack — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment sql/src/main/java/org/apache/druid/sql/calcite/run/NativeQueryMaker.java:129— // Hack for timeseries queries: when generating them, DruidQuery.toTimeseriesQuery translates a dimension — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment services/src/main/java/org/apache/druid/cli/Main.java:103— // Hack to work around Help not liking being injected — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment processing/src/test/java/org/apache/druid/segment/TestHelper.java:207— // HACK! Special casing for groupBy — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment processing/src/test/java/org/apache/druid/segment/TestHelper.java:290— // HACK! Special casing for groupBy — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment processing/src/main/java/org/apache/druid/utils/CompressionUtils.java:598— // Hack. Docs say available() should return an estimate, — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×7
Edited copy of a member (34 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:68— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:68-101 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:68-101 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:48— processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:48-81 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:91-124 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:286— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:286-321 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:361-394 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java:218— processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java:218-255 | processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java:270-303 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:476— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:476-509 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:570-603 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) processing/src/main/java/org/apache/druid/regex/RegexPatternFactory.java:38— processing/src/main/java/org/apache/druid/regex/RegexPatternFactory.java:38-71 | processing/src/main/java/org/apache/druid/regex/RegexPatternFactory.java:74-107 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java:210— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java:210-243 | processing/src/main/java/org/apache/druid/query/aggregation/HistogramAggregatorFactory.java:95-133 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×7
Edited copies of one member (3 members, 18+ corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableDoubleGroupByVectorColumnSelector.java:51— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableDoubleGroupByVectorColumnSelector.java:51-68 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableFloatGroupByVectorColumnSelector.java:51-68 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/NullableLongGroupByVectorColumnSelector.java:51-68 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) processing/src/main/java/org/apache/druid/java/util/metrics/CgroupV2DiskMonitor.java:72— processing/src/main/java/org/apache/druid/java/util/metrics/CgroupV2DiskMonitor.java:72-94 | processing/src/main/java/org/apache/druid/java/util/metrics/OshiSysMonitor.java:227-244 | processing/src/main/java/org/apache/druid/java/util/metrics/OshiSysMonitor.java:253-278 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) extensions-contrib/opentsdb-emitter/src/main/java/org/apache/druid/emitter/opentsdb/EventConverter.java:108— extensions-contrib/opentsdb-emitter/src/main/java/org/apache/druid/emitter/opentsdb/EventConverter.java:108-125 | extensions-contrib/prometheus-emitter/src/main/java/org/apache/druid/emitter/prometheus/Metrics.java:134-151 | extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/DimensionConverter.java:80-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:75— processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:75-92 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:82-100 | processing/src/main/java/org/apache/druid/segment/serde/ComplexMetrics.java:53-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java:90— extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java:90-109 | processing/src/main/java/org/apache/druid/segment/BaseSingleValueDimensionSelector.java:79-97 | processing/src/main/java/org/apache/druid/segment/SingleScanTimeDimensionSelector.java:103-120 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) processing/src/main/java/org/apache/druid/common/utils/PropUtils.java:47— processing/src/main/java/org/apache/druid/common/utils/PropUtils.java:47-64 | processing/src/main/java/org/apache/druid/java/util/common/MapUtils.java:49-66 | processing/src/main/java/org/apache/druid/java/util/common/MapUtils.java:69-86 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:131— extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:131-149 | extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeDiscoveryProvider.java:138-157 | server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidNodeDiscoveryProvider.java:127-144 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×7
Edited copies of one member (3 members, 17+ corresponding lines) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java:127— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java:127-149 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java:153-174 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java:178-194 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) processing/src/main/java/org/apache/druid/collections/DefaultBlockingPool.java:171— processing/src/main/java/org/apache/druid/collections/DefaultBlockingPool.java:171-188 | processing/src/main/java/org/apache/druid/collections/DefaultBlockingPool.java:191-211 | processing/src/main/java/org/apache/druid/collections/DefaultBlockingPool.java:214-230 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:122— processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:122-138 | processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarIntsSupplier.java:154-175 | processing/src/main/java/org/apache/druid/segment/data/CompressedVariableSizedBlobColumnSupplier.java:53-74 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:96— processing/src/main/java/org/apache/druid/segment/DoubleColumnSerializerV2.java:96-112 | processing/src/main/java/org/apache/druid/segment/FloatColumnSerializerV2.java:96-112 | processing/src/main/java/org/apache/druid/segment/LongColumnSerializerV2.java:101-118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java:68— extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java:68-86 | processing/src/main/java/org/apache/druid/segment/BaseSingleValueDimensionSelector.java:59-75 | processing/src/main/java/org/apache/druid/segment/SingleScanTimeDimensionSelector.java:83-99 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java:117— processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java:117-133 | processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java:115-131 | processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerdeV2.java:117-133 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorReportPayload.java:48— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorReportPayload.java:48-67 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorReportPayload.java:54-74 | processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:177-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (26 lines × 2) processing/src/main/java/org/apache/druid/java/util/emitter/core/LoggingEmitter.java:155— processing/src/main/java/org/apache/druid/java/util/emitter/core/LoggingEmitter.java:155-180 | processing/src/main/java/org/apache/druid/java/util/emitter/core/LoggingEmitter.java:242-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/emitter/core/LoggingEmitter.java:155` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:342— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:342-367 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:451-476 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:289— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:289-314 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:221-246 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:289` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1102— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1102-1127 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:416-441 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1129` calls `get` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:443` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (26 lines × 2) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:258— server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:258-283 | server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:688-713 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:258` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportConfig.java:46— extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportConfig.java:46-71 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3ExportConfig.java:46-72 — before extracting anything, compare `extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/output/GoogleExportConfig.java` and `extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3ExportConfig.java` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialHashSegmentGenerateParallelIndexTaskRunner.java:69— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialHashSegmentGenerateParallelIndexTaskRunner.java:69-94 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialRangeSegmentGenerateParallelIndexTaskRunner.java:68-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 4) extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java:65— extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java:65-71 | extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageDruidModule.java:105-111 | extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java:67-73 | extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/ParquetExtensionsModule.java:72-78 — before extracting anything, compare `extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java` and `extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageDruidModule.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchObjectSqlAggregator.java:97— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchObjectSqlAggregator.java:97-103 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:97-103 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:111-117 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:125-131 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchObjectSqlAggregator.java:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:94` calls `value`, `floatValue` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:108` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:862— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:862-868 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1304-1310 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1393-1399 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1480-1486 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:862` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:870` calls `doubleValue`, `floatValue` and `processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1312` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerde.java:103— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerde.java:103-109 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexMetricSerde.java:104-110 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexMetricSerde.java:103-109 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:156-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:101— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:101-108 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:100-107 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java:98-104 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastAggregatorFactory.java:99-105 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchMergeAggregatorFactory.java:59— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchMergeAggregatorFactory.java:59-65 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchMergeAggregatorFactory.java:69-75 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchMergeAggregatorFactory.java:59-65 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchMergeAggregatorFactory.java:69-75 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexColumn.java:123— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexColumn.java:123-129 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexColumn.java:123-129 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexColumn.java:123-129 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexColumn.java:126-133 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexColumn.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexColumn.java` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 4) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:851— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:851-856 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1069-1074 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1084-1089 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1326-1331 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:851` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:859` calls `ColumnMetadata` and `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1077` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:881— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:881-886 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1362-1367 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1368-1373 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1550-1555 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1375` calls `ColumnMetadata` and `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1557` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Cpu.java:62— processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Cpu.java:62-68 | processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/CpuV2.java:66-71 | processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Disk.java:61-66 | processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Disk.java:84-89 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Cpu.java:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 4) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:263— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:263-268 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:287-292 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:319-324 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:346-351 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:206— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:206-211 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:201-206 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:212-217 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:832-837 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/sql/Bitmap64ExactCountSqlAggregator.java:178— extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/sql/Bitmap64ExactCountSqlAggregator.java:178-184 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchApproxCountDistinctSqlAggregator.java:107-112 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchApproxCountDistinctUtf8SqlAggregator.java:78-83 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchApproxCountDistinctSqlAggregator.java:94-102 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 4) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyAttemptsForJob.java:93— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyAttemptsForJob.java:93-98 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyAttemptsForWorker.java:92-97 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerFailedFault.java:68-73 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerRpcFailedFault.java:66-71 — before extracting anything, compare `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerFailedFault.java` and `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/WorkerRpcFailedFault.java` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
AC2 · Forms & labels· <TextArea> field component without a label · ×6
<TextArea> field component without a label web-console/src/components/array-input/array-input.tsx:64— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<TextArea> field component without a label web-console/src/components/formatted-input/formatted-input.tsx:100— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<TextArea> field component without a label web-console/src/components/json-collapse/json-collapse.tsx:46— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<TextArea> field component without a label web-console/src/components/show-value/show-value.tsx:53— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<TextArea> field component without a label web-console/src/dialogs/show-value-dialog/show-value-dialog.tsx:96— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<TextArea> field component without a label web-console/src/views/load-data-view/load-data-view.tsx:1309— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <NumericInput> field component without a label · ×6
<NumericInput> field component without a label web-console/src/components/auto-form/auto-form.tsx:333— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumericInput> field component without a label web-console/src/components/console-table/console-table-pagination/page-jump-dialog/page-jump-dialog.tsx:46— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumericInput> field component without a label web-console/src/components/rule-editor/tiered-replicant.tsx:63— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumericInput> field component without a label web-console/src/dialogs/numeric-input-dialog/numeric-input-dialog.tsx:62— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumericInput> field component without a label web-console/src/views/explore-view/components/filter-pane/filter-menu/number-range-filter-control/number-range-filter-control.tsx:42— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumericInput> field component without a label web-console/src/views/explore-view/components/filter-pane/filter-menu/number-range-filter-control/number-range-filter-control.tsx:60— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×6
Edited copy of a member (36 corresponding lines) processing/src/main/java/org/apache/druid/query/topn/TopNLexicographicResultBuilder.java:79— processing/src/main/java/org/apache/druid/query/topn/TopNLexicographicResultBuilder.java:79-128 | processing/src/main/java/org/apache/druid/query/topn/TopNNumericResultBuilder.java:96-164 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:89— processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:89-133 | processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidgetImpl.java:141-194 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:269— processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:269-306 | processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:311-346 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:192— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregatorFactory.java:192-227 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregatorFactory.java:162-200 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:56— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:56-100 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSimpleStagedSerde.java:55-90 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:43— processing/src/main/java/org/apache/druid/collections/bitmap/ConciseBitmapFactory.java:43-78 | processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java:60-95 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×6
Edited copy of a member (51 corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:205— processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:205-257 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:420-472 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:910— processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:910-960 | processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:968-1042 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:597— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:597-647 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:435-487 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryStageProcessor.java:115— multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryStageProcessor.java:115-165 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPostShuffleStageProcessor.java:81-142 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:389— processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:389-450 | processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java:406-456 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/guice/CatalogClientModule.java:62— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/guice/CatalogClientModule.java:62-114 | extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/guice/CatalogCoordinatorModule.java:56-106 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×6
Edited copy of a member (43 corresponding lines) server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:163— server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:163-211 | sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCache.java:109-156 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) server/src/main/java/org/apache/druid/client/BrokerServerView.java:271— server/src/main/java/org/apache/druid/client/BrokerServerView.java:271-313 | server/src/main/java/org/apache/druid/client/CoordinatorServerView.java:174-220 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) processing/src/main/java/org/apache/druid/query/CursorGranularizer.java:57— processing/src/main/java/org/apache/druid/query/CursorGranularizer.java:57-99 | processing/src/main/java/org/apache/druid/query/vector/VectorCursorGranularizer.java:55-98 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:163— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:163-205 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java:211-262 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java:347— processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java:347-389 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:641-687 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:126— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:126-168 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:579-623 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×6
Edited copy of a member (46 corresponding lines) server/src/main/java/org/apache/druid/client/selector/PooledTierSelectorStrategy.java:87— server/src/main/java/org/apache/druid/client/selector/PooledTierSelectorStrategy.java:87-132 | server/src/main/java/org/apache/druid/client/selector/StrictTierSelectorStrategy.java:118-163 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/AbstractSerializablePairLongObjectDeltaEncodedStagedSerde.java:62— processing/src/main/java/org/apache/druid/query/aggregation/AbstractSerializablePairLongObjectDeltaEncodedStagedSerde.java:62-118 | processing/src/main/java/org/apache/druid/query/aggregation/AbstractSerializablePairLongObjectSimpleStagedSerde.java:52-97 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:107— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:107-153 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:116-161 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:257— server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:257-311 | server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:687-732 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:893— server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:893-938 | server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:315-365 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesOverlordModule.java:301— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesOverlordModule.java:301-349 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/MultipleKubernetesTaskRunnerFactory.java:351-396 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×6
Edited copies of one member (3 members, 26+ corresponding lines) processing/src/main/java/org/apache/druid/query/rowsandcols/column/DoubleArrayColumn.java:53— processing/src/main/java/org/apache/druid/query/rowsandcols/column/DoubleArrayColumn.java:53-78 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/IntArrayColumn.java:53-78 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/LongArrayColumn.java:53-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java:145— processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java:145-171 | processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java:143-168 | processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerdeV2.java:145-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/parsers/JavaScriptParser.java:35— processing/src/main/java/org/apache/druid/java/util/common/parsers/JavaScriptParser.java:35-60 | processing/src/main/java/org/apache/druid/query/aggregation/post/JavaScriptPostAggregator.java:54-79 | processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java:41-67 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:567— processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:567-592 | processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:595-620 | processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:623-648 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) processing/src/main/java/org/apache/druid/frame/field/DoubleArrayFieldReader.java:49— processing/src/main/java/org/apache/druid/frame/field/DoubleArrayFieldReader.java:49-74 | processing/src/main/java/org/apache/druid/frame/field/FloatArrayFieldReader.java:49-74 | processing/src/main/java/org/apache/druid/frame/field/LongArrayFieldReader.java:41-66 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/data/input/aliyun/OssInputSource.java:123— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/data/input/aliyun/OssInputSource.java:123-153 | extensions-core/google-extensions/src/main/java/org/apache/druid/data/input/google/GoogleCloudStorageInputSource.java:122-147 | extensions-core/s3-extensions/src/main/java/org/apache/druid/data/input/s3/S3InputSource.java:255-286 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 16+ corresponding lines) · ×6
Edited copies of one member (4 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMeanVectorAggregator.java:98— processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMeanVectorAggregator.java:98-113 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleSumVectorAggregator.java:53-68 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdFloatSumVectorAggregator.java:53-68 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdLongSumVectorAggregator.java:53-68 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchBuildBufferAggregatorHelper.java:58— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchBuildBufferAggregatorHelper.java:58-73 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchMergeBufferAggregatorHelper.java:67-82 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildBufferAggregatorHelper.java:65-80 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchMergeBufferAggregatorHelper.java:72-87 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java:83— processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java:83-98 | processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java:83-98 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java:83-98 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java:83-98 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/query/MetricValueExtractor.java:72— processing/src/main/java/org/apache/druid/query/MetricValueExtractor.java:72-87 | processing/src/main/java/org/apache/druid/query/search/SearchHit.java:81-99 | processing/src/main/java/org/apache/druid/query/search/SearchResultValue.java:64-79 | processing/src/main/java/org/apache/druid/query/topn/DimensionAndMetricValueExtractor.java:48-63 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:228— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:228-243 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordDataSourcesResource.java:253-268 | server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:670-685 | server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:700-715 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/LikeFilter.java:145— processing/src/main/java/org/apache/druid/segment/filter/LikeFilter.java:145-162 | processing/src/main/java/org/apache/druid/segment/filter/RegexFilter.java:138-155 | processing/src/main/java/org/apache/druid/segment/filter/SearchQueryFilter.java:72-89 | processing/src/main/java/org/apache/druid/segment/filter/SelectorFilter.java:151-166 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 19+ corresponding lines) · ×6
Edited copies of one member (4 members, 19+ corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:340— processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:340-359 | processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:364-382 | processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:700-718 | processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:723-742 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 19+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:95— processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:95-113 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:126-144 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:272-291 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:300-318 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 19+ corresponding lines) processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:63— processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:63-81 | processing/src/main/java/org/apache/druid/java/util/emitter/core/ComposingEmitter.java:86-104 | processing/src/main/java/org/apache/druid/java/util/emitter/core/SwitchingEmitter.java:121-139 | processing/src/main/java/org/apache/druid/java/util/emitter/core/SwitchingEmitter.java:148-166 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 19+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/DictionaryIdLookup.java:206— processing/src/main/java/org/apache/druid/segment/nested/DictionaryIdLookup.java:206-229 | processing/src/main/java/org/apache/druid/segment/nested/DictionaryIdLookup.java:232-250 | processing/src/main/java/org/apache/druid/segment/nested/DictionaryIdLookup.java:253-271 | processing/src/main/java/org/apache/druid/segment/nested/DictionaryIdLookup.java:274-292 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 19+ corresponding lines) extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountAggregatorFactory.java:220— extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountAggregatorFactory.java:220-238 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregatorFactory.java:299-320 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchSetPostAggregator.java:151-172 | processing/src/main/java/org/apache/druid/query/aggregation/post/JavaScriptPostAggregator.java:205-226 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 19+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchToStringOperatorConversion.java:74— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchToStringOperatorConversion.java:74-92 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchSummaryOperatorConversion.java:74-92 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchEstimateOperatorConversion.java:74-93 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/sql/ArrayOfDoublesSketchMetricsSumEstimateOperatorConversion.java:75-93 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×6
Edited copies of one member (3 members, 9+ corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java:353— processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java:353-361 | processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java:365-373 | processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java:377-385 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemoryDatasourceSegmentCache.java:260— server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemoryDatasourceSegmentCache.java:260-269 | server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemoryDatasourceSegmentCache.java:683-691 | server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemoryDatasourceSegmentCache.java:695-703 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1028— processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1028-1036 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1040-1048 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1052-1060 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:56— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:56-64 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:56-64 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:56-64 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountAggregatorFactory.java:184— extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountAggregatorFactory.java:184-193 | processing/src/main/java/org/apache/druid/query/aggregation/FilteredAggregatorFactory.java:194-202 | processing/src/main/java/org/apache/druid/query/filter/SpatialDimFilter.java:70-80 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/exec/OutputChannelMode.java:71— multi-stage-query/src/main/java/org/apache/druid/msq/exec/OutputChannelMode.java:71-79 | multi-stage-query/src/main/java/org/apache/druid/msq/kernel/ShuffleKind.java:80-88 | processing/src/main/java/org/apache/druid/data/input/impl/systemfield/SystemField.java:53-61 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (31 lines × 2) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:766— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:766-796 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:798-828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:798` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (31 lines × 2) extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:53— extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:53-83 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexTuningConfig.java:83-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:53` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:365— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:365-395 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:308-338 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:365` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:200— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:200-230 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:137-167 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:168` calls `FixedIndexedIntWriter`, `open` and `processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:231` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (31 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchNoOpAggregator.java:29— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchNoOpAggregator.java:29-59 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchNoOpBufferAggregator.java:35-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (31 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/NoopArrayOfDoublesSketchAggregator.java:32— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/NoopArrayOfDoublesSketchAggregator.java:32-62 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/NoopArrayOfDoublesSketchBufferAggregator.java:35-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (29 lines × 2) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:202— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:202-230 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java:235-263 — before extracting anything, compare `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java` and `extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:202` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java:232` calls `statusCode`, `IOE`, `getBucket` and `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:201` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (29 lines × 2) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:108— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:108-136 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java:125-153 — before extracting anything, compare `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:516— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:516-544 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:678-706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:516` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:229— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:229-257 | processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java:200-228 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java` and `processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:293— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:293-321 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:343-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (29 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/LPadOperatorConversion.java:59— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/LPadOperatorConversion.java:59-87 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RPadOperatorConversion.java:59-87 — before extracting anything, compare `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/LPadOperatorConversion.java` and `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RPadOperatorConversion.java` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12–13 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1610— multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1610-1621 | multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1626-1638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1610` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:71— processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:71-82 | processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:107-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:324— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:324-336 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:322-333 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:78— sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:78-89 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArraySqlAggregator.java:80-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–13 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:524— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:524-535 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:695-707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:524` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:328— sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:328-339 | sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:488-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 3) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulMetrics.java:36— extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulMetrics.java:36-47 | extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulMetrics.java:53-64 | extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulMetrics.java:71-82 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:246— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:246-257 | processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:462-473 | processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java:217-228 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java` and `processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:297— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:297-308 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:347-358 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:309-320 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java` and `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `values` to `byte[][]` in one and `int[][]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 3) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1334— sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1334-1345 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1381-1392 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1671-1682 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregateCombiner.java:40— extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregateCombiner.java:40-51 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/min/CompressedBigDecimalMinAggregateCombiner.java:40-51 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/sum/CompressedBigDecimalSumAggregateCombiner.java:40-51 — before extracting anything, compare `extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregateCombiner.java` and `extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/min/CompressedBigDecimalMinAggregateCombiner.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/DoubleColumnAccessorBase.java:66— processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/DoubleColumnAccessorBase.java:66-77 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/FloatColumnAccessorBase.java:66-77 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/LongColumnAccessorBase.java:66-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 2) extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapTypeMapVirtualColumnDimensionSelector.java:120— extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapTypeMapVirtualColumnDimensionSelector.java:120-128 | extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java:182-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4572— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4572-4580 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4584-4593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4572` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:378— processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:378-387 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:404-412 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:378` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9–10 lines × 2) processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:1161— processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:1161-1169 | processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:1280-1289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:1161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:172— server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:172-180 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:239-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9–10 lines × 2) server/src/main/java/org/apache/druid/server/SegmentManager.java:199— server/src/main/java/org/apache/druid/server/SegmentManager.java:199-207 | server/src/main/java/org/apache/druid/server/ServerManager.java:353-362 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/ServerManager.java:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:87— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:87-94 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:114-122 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchBaseSqlAggregator.java:85-92 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:97-105 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:113` calls `getNumericLiteral`, `value`, `floatValue` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:85` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:114— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:114-122 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchObjectSqlAggregator.java:95-103 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:96-103 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:97-105 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 4) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:54— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:54-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:56-63 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:54-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:54-61 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) sql/src/main/java/org/apache/druid/sql/calcite/filtration/BottomUpTransform.java:60— sql/src/main/java/org/apache/druid/sql/calcite/filtration/BottomUpTransform.java:60-67 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/BottomUpTransform.java:74-81 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/RemoveRedundantIsTrue.java:62-69 | sql/src/main/java/org/apache/druid/sql/calcite/filtration/RemoveRedundantIsTrue.java:76-83 — before extracting anything, compare `sql/src/main/java/org/apache/druid/sql/calcite/filtration/BottomUpTransform.java` and `sql/src/main/java/org/apache/druid/sql/calcite/filtration/RemoveRedundantIsTrue.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/filtration/BottomUpTransform.java:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchOperations.java:51— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchOperations.java:51-58 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchOperations.java:51-58 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchOperations.java:51-58 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchOperations.java:120-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexColumn.java:81— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexColumn.java:81-88 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexColumn.java:81-88 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexColumn.java:81-88 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexColumn.java:84-91 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexColumn.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexColumn.java` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
AC2 · Forms & labels· <HTMLSelect> field component without a label · ×5
<HTMLSelect> field component without a label web-console/src/components/console-table/table-filter-inputs.tsx:178— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<HTMLSelect> field component without a label web-console/src/components/rule-editor/rule-editor.tsx:161— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<HTMLSelect> field component without a label web-console/src/dialogs/diff-dialog/diff-dialog.tsx:102— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<HTMLSelect> field component without a label web-console/src/dialogs/diff-dialog/diff-dialog.tsx:113— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<HTMLSelect> field component without a label web-console/src/views/workbench-view/column-tree/column-tree.tsx:604— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <RadioGroup> field component without a label · ×5
<RadioGroup> field component without a label web-console/src/dialogs/supervisor-to-sql-dialog/supervisor-to-sql-dialog.tsx:208— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label web-console/src/dialogs/supervisor-to-sql-dialog/supervisor-to-sql-dialog.tsx:272— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label web-console/src/views/load-data-view/load-data-view.tsx:1394— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label web-console/src/views/sql-data-loader-view/destination-form/destination-form.tsx:111— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label web-console/src/views/workbench-view/input-source-step/input-source-step.tsx:221— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (6 members, 50+ identical tokens) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssStorageDruidModule.java:47— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssStorageDruidModule.java:47-70 | extensions-contrib/cassandra-storage/src/main/java/org/apache/druid/storage/cassandra/CassandraDruidModule.java:53-76 | extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureStorageDruidModule.java:55-82 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageDruidModule.java:64-87 | processing/src/main/java/org/apache/druid/initialization/TombstoneDataStorageModule.java:36-59 | server/src/main/java/org/apache/druid/guice/LocalDataStorageDruidModule.java:94-117 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) extensions-core/testing-tools/src/main/java/org/apache/druid/testing/cli/CliEventCollector.java:123— extensions-core/testing-tools/src/main/java/org/apache/druid/testing/cli/CliEventCollector.java:123-171 | services/src/main/java/org/apache/druid/cli/CliOverlord.java:538-599 | services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java:72-148 | services/src/main/java/org/apache/druid/cli/MiddleManagerJettyServerInitializer.java:65-110 | services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java:91-174 | services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java:98-163 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAbsProcessor.java:41— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAbsProcessor.java:41-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleNegProcessor.java:41-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleSqrtProcessor.java:43-58 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongAbsProcessor.java:41-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongNegProcessor.java:41-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSqrtProcessor.java:45-62 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/query/filter/vector/ArrayVectorValueMatcher.java:63— processing/src/main/java/org/apache/druid/query/filter/vector/ArrayVectorValueMatcher.java:63-93 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:44-78 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:93-127 | processing/src/main/java/org/apache/druid/query/filter/vector/ObjectVectorValueMatcher.java:71-98 | processing/src/main/java/org/apache/druid/query/filter/vector/StringObjectVectorValueMatcher.java:46-70 | processing/src/main/java/org/apache/druid/query/filter/vector/StringObjectVectorValueMatcher.java:85-112 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:776— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:776-796 | processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:859-896 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1301-1335 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1390-1423 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1477-1510 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1570-1589 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Edited copy of a member (50 corresponding lines) · ×5
Edited copy of a member (50 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/Parser.java:381— processing/src/main/java/org/apache/druid/math/expr/Parser.java:381-430 | processing/src/main/java/org/apache/druid/math/expr/Parser.java:447-496 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (50 corresponding lines) extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:209— extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:209-258 | extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:300-350 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (50 corresponding lines) server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java:801— server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java:801-850 | server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java:855-904 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (50 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/IPv4AddressMatchExprMacro.java:69— processing/src/main/java/org/apache/druid/query/expression/IPv4AddressMatchExprMacro.java:69-131 | processing/src/main/java/org/apache/druid/query/expression/IPv6AddressMatchExprMacro.java:61-110 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (50 corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java:193— processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java:193-256 | processing/src/main/java/org/apache/druid/segment/filter/NotFilter.java:182-231 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×5
Edited copy of a member (40 corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:227— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:227-266 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java:142-181 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1577— server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1577-1618 | server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1631-1670 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:245— server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:245-286 | server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:300-339 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:85— extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:85-124 | extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeAnnouncer.java:128-167 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:89— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:89-128 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java:90-129 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×5
Edited copy of a member (27 corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssStorageDruidModule.java:74— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssStorageDruidModule.java:74-100 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageDruidModule.java:91-123 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:184— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:184-210 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:218-244 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:500— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:500-526 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:578-615 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) processing/src/main/java/org/apache/druid/query/operator/window/value/WindowFirstProcessor.java:62— processing/src/main/java/org/apache/druid/query/operator/window/value/WindowFirstProcessor.java:62-88 | processing/src/main/java/org/apache/druid/query/operator/window/value/WindowLastProcessor.java:62-89 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeFactory.java:98— processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeFactory.java:98-124 | processing/src/main/java/org/apache/druid/segment/column/ColumnTypeFactory.java:96-125 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×5
Edited copies of one member (4 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/DimensionPredicateFilter.java:237— processing/src/main/java/org/apache/druid/segment/filter/DimensionPredicateFilter.java:237-249 | processing/src/main/java/org/apache/druid/segment/filter/JavaScriptFilter.java:98-109 | processing/src/main/java/org/apache/druid/segment/filter/LikeFilter.java:182-194 | processing/src/main/java/org/apache/druid/segment/filter/SpatialFilter.java:146-157 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleProcessor.java:63— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleProcessor.java:63-74 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongProcessor.java:66-77 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleProcessor.java:66-77 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongProcessor.java:64-75 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMaxAverager.java:32— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMaxAverager.java:32-43 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMinAverager.java:32-43 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMaxAverager.java:32-43 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMinAverager.java:32-43 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/CoordinatorBasicAuthenticatorResourceHandler.java:73— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/CoordinatorBasicAuthenticatorResourceHandler.java:73-85 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:86-97 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:101-112 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:214-226 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/data/input/aliyun/OssInputSource.java:172— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/data/input/aliyun/OssInputSource.java:172-185 | extensions-core/google-extensions/src/main/java/org/apache/druid/data/input/google/GoogleCloudStorageInputSource.java:105-118 | extensions-core/s3-extensions/src/main/java/org/apache/druid/data/input/s3/S3InputSource.java:310-323 | processing/src/main/java/org/apache/druid/data/input/impl/LocalInputSource.java:258-269 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (16–17 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:898— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:898-913 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:984-1000 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:898` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16–17 lines × 2) processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:477— processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:477-492 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:568-584 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java:477` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:247— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:247-263 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:302-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:189— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:189-205 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:244-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidAggregateCaseToFilterRule.java:235— sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidAggregateCaseToFilterRule.java:235-250 | sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidAggregateCaseToFilterRule.java:284-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 4) processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:133— processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:133-142 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:172-181 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:254-263 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:294-303 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:133` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `ExprParser.AddSubExprContext` in one and `ExprParser.LogicalAndOrExprContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 4) processing/src/main/java/org/apache/druid/math/expr/vector/IfDoubleVectorProcessor.java:75— processing/src/main/java/org/apache/druid/math/expr/vector/IfDoubleVectorProcessor.java:75-84 | processing/src/main/java/org/apache/druid/math/expr/vector/IfDoubleVectorProcessor.java:88-97 | processing/src/main/java/org/apache/druid/math/expr/vector/IfLongVectorProcessor.java:76-85 | processing/src/main/java/org/apache/druid/math/expr/vector/IfLongVectorProcessor.java:89-98 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java:54— processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java:54-63 | processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java:54-63 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java:54-63 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java:54-63 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java` and `processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTaskLogs.java:156— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTaskLogs.java:156-165 | extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureTaskLogs.java:191-200 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleTaskLogs.java:187-196 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TaskLogs.java:209-218 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (10 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java:94— processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java:94-103 | processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java:107-116 | processing/src/main/java/org/apache/druid/query/aggregation/any/FloatAnyAggregatorFactory.java:91-100 | processing/src/main/java/org/apache/druid/query/aggregation/any/LongAnyAggregatorFactory.java:90-99 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 4) extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchQuantilePostAggregator.java:53— extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchQuantilePostAggregator.java:53-57 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilesPostAggregator.java:51-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToQuantilesPostAggregator.java:51-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilesPostAggregator.java:51-55 — before extracting anything, compare `extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchQuantilePostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilesPostAggregator.java` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:64— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:64-68 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:71-75 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java:72-76 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java:79-83 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java:158— processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java:158-162 | processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java:158-162 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java:158-162 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java:158-162 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java` and `processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 4) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:60— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:60-64 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:55-59 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:60-64 | processing/src/main/java/org/apache/druid/segment/data/IndexedInts.java:56-60 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `out` to `double[]` in one and `float[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 4) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:930— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:930-934 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:998-1002 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1042-1046 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1087-1091 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:930` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2 locations) web-console/src/components/auto-form/auto-form.tsx:263— web-console/src/components/auto-form/auto-form.tsx:263 · web-console/src/components/auto-form/auto-form.tsx:294 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (21 lines × 2 locations) web-console/src/components/record-table-pane/record-table-pane.tsx:75— web-console/src/components/record-table-pane/record-table-pane.tsx:75 · web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:599 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (21 lines × 2 locations) web-console/src/utils/sampler.ts:496— web-console/src/utils/sampler.ts:496 · web-console/src/utils/sampler.ts:565 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (21 lines × 2 locations) web-console/src/views/load-data-view/load-data-view.tsx:2247— web-console/src/views/load-data-view/load-data-view.tsx:2247 · web-console/src/views/load-data-view/load-data-view.tsx:2416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2 locations) web-console/src/views/supervisors-view/supervisors-view.tsx:1390— web-console/src/views/supervisors-view/supervisors-view.tsx:1390 · web-console/src/views/tasks-view/tasks-view.tsx:687 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (20 lines × 2 locations) web-console/src/dialogs/datasource-table-action-dialog/datasource-preview-pane/datasource-preview-pane.tsx:46— web-console/src/dialogs/datasource-table-action-dialog/datasource-preview-pane/datasource-preview-pane.tsx:46 · web-console/src/dialogs/segments-table-action-dialog/segments-preview-pane/segments-preview-pane.tsx:100 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (20 lines × 2 locations) web-console/src/views/datasources-view/datasources-view.tsx:513— web-console/src/views/datasources-view/datasources-view.tsx:513 · web-console/src/views/datasources-view/datasources-view.tsx:545 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (20 lines × 2 locations) web-console/src/views/explore-view/components/resource-pane/resource-pane.tsx:202— web-console/src/views/explore-view/components/resource-pane/resource-pane.tsx:202 · web-console/src/views/explore-view/components/resource-pane/resource-pane.tsx:285 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (20 lines × 2 locations) web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:157— web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:157 · web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:180 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (20 lines × 2 locations) web-console/src/views/workbench-view/column-tree/column-tree.tsx:375— web-console/src/views/workbench-view/column-tree/column-tree.tsx:375 · web-console/src/views/workbench-view/column-tree/column-tree.tsx:403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×4
Edited copies of one member (3 members, 30+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateDoubleProcessorFactory.java:39— processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateDoubleProcessorFactory.java:39-68 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateLongProcessorFactory.java:39-74 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateProcessorFactory.java:40-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 30+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:66— processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:66-95 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:132-174 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:184-214 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 30+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java:77— indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java:77-110 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/MoveTask.java:85-114 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/RestoreTask.java:78-124 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 30+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:191— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:191-220 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:332-361 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:365-394 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×4
Edited copy of a member (35 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskLocks.java:111— indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskLocks.java:111-145 | indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskLocks.java:271-305 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) server/src/main/java/org/apache/druid/server/http/SegmentListerResource.java:120— server/src/main/java/org/apache/druid/server/http/SegmentListerResource.java:120-154 | server/src/main/java/org/apache/druid/server/http/SegmentListerResource.java:176-210 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstAggregator.java:62— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstAggregator.java:62-96 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastAggregator.java:60-95 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/SwitchingTaskLogStreamer.java:52— indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/SwitchingTaskLogStreamer.java:52-86 | indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/SwitchingTaskLogStreamer.java:90-125 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×4
Edited copies of one member (3 members, 24+ corresponding lines) processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:569— processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:569-595 | processing/src/main/java/org/apache/druid/segment/nested/VariantArrayFieldColumnWriter.java:46-76 | processing/src/main/java/org/apache/druid/segment/nested/VariantFieldColumnWriter.java:44-67 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 24+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java:72— processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java:72-100 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/SingleValueStringCardinalityVectorProcessor.java:67-90 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/StringObjectCardinalityVectorProcessor.java:66-90 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 24+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FixedIndexed.java:144— processing/src/main/java/org/apache/druid/segment/data/FixedIndexed.java:144-167 | processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:542-566 | processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:673-709 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 24+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/BTrimOperatorConversion.java:58— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/BTrimOperatorConversion.java:58-81 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/LTrimOperatorConversion.java:58-81 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RTrimOperatorConversion.java:58-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 24+ corresponding lines) · ×4
Edited copies of one member (4 members, 24+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMeanVectorAggregator.java:72— processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMeanVectorAggregator.java:72-95 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleSumVectorAggregator.java:72-97 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdFloatSumVectorAggregator.java:72-97 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdLongSumVectorAggregator.java:72-97 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 24+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:538— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:538-561 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:586-609 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:700-723 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:748-771 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 24+ corresponding lines) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/execution/KubernetesTaskExecutionConfigResource.java:122— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/execution/KubernetesTaskExecutionConfigResource.java:122-145 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:465-488 | server/src/main/java/org/apache/druid/server/http/CoordinatorBrokerConfigsResource.java:121-146 | server/src/main/java/org/apache/druid/server/http/CoordinatorDynamicConfigsResource.java:119-144 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 24+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleBufferStore.java:35— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleBufferStore.java:35-59 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatBufferStore.java:35-59 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongBufferStore.java:34-58 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringBufferStore.java:34-57 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×4
Edited copies of one member (3 members, 19+ corresponding lines) processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:1329— processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:1329-1348 | processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java:439-460 | processing/src/main/java/org/apache/druid/query/topn/TopNQuery.java:265-283 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:85— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:85-105 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:85-105 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:86-104 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:130— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:130-155 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java:122-147 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarLongsSupplier.java:190-208 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/input/table/DataSegmentWithLocation.java:69— multi-stage-query/src/main/java/org/apache/druid/msq/input/table/DataSegmentWithLocation.java:69-88 | processing/src/main/java/org/apache/druid/timeline/DataSegment.java:222-240 | server/src/main/java/org/apache/druid/server/coordination/LoadableDataSegment.java:62-80 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×4
Edited copies of one member (4 members, 11+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:369— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:369-382 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:401-414 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:881-891 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:920-930 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 11+ corresponding lines) processing/src/main/java/org/apache/druid/segment/serde/DictionaryEncodedColumnPartSerde.java:479— processing/src/main/java/org/apache/druid/segment/serde/DictionaryEncodedColumnPartSerde.java:479-490 | processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java:175-185 | processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java:172-182 | processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerdeV2.java:174-184 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 11+ corresponding lines) server/src/main/java/org/apache/druid/server/initialization/jetty/ChatHandlerServerModule.java:102— server/src/main/java/org/apache/druid/server/initialization/jetty/ChatHandlerServerModule.java:102-112 | server/src/main/java/org/apache/druid/server/initialization/jetty/CliIndexerServerModule.java:122-132 | server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java:151-161 | services/src/main/java/org/apache/druid/guice/PeonServerModule.java:69-79 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 11+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/SegmentLock.java:221— indexing-service/src/main/java/org/apache/druid/indexing/common/SegmentLock.java:221-232 | indexing-service/src/main/java/org/apache/druid/indexing/common/TimeChunkLock.java:202-212 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/SpecificSegmentLockRequest.java:160-171 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TimeChunkLockRequest.java:149-159 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 14+ corresponding lines) · ×4
Edited copies of one member (4 members, 14+ corresponding lines) server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:156— server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:156-170 | server/src/main/java/org/apache/druid/server/listener/resource/AbstractListenerHandler.java:127-140 | server/src/main/java/org/apache/druid/server/listener/resource/AbstractListenerHandler.java:144-158 | server/src/main/java/org/apache/druid/server/listener/resource/AbstractListenerHandler.java:162-175 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:191— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:191-204 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:222-235 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorIOConfig.java:190-204 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:220-235 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:345— sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:345-359 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidJoinQueryRel.java:342-356 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidOuterQueryRel.java:187-201 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQueryRel.java:209-222 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthUtils.java:125— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthUtils.java:125-138 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthUtils.java:157-170 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthUtils.java:186-199 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthUtils.java:215-228 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 13+ corresponding lines) · ×4
Edited copies of one member (5 members, 13+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeVectorAggregator.java:82— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeVectorAggregator.java:82-94 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchMergeVectorAggregator.java:73-85 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchMergeVectorAggregator.java:73-85 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchMergeVectorAggregator.java:74-86 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchVectorAggregator.java:81-93 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 13+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidRules.java:197— sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidRules.java:197-209 | sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidRules.java:220-232 | sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidRules.java:243-255 | sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidRules.java:266-278 | sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidRules.java:289-301 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 13+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:52— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:52-64 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:71-83 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:87-100 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:104-117 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/util/ToObjectVectorColumnProcessorFactory.java:121-134 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 13+ corresponding lines) processing/src/main/java/org/apache/druid/query/operator/window/WindowFrame.java:111— processing/src/main/java/org/apache/druid/query/operator/window/WindowFrame.java:111-123 | processing/src/main/java/org/apache/druid/query/operator/window/WindowFrame.java:177-191 | processing/src/main/java/org/apache/druid/query/operator/window/WindowFramedAggregateProcessor.java:124-136 | processing/src/main/java/org/apache/druid/query/operator/window/ranking/WindowRankingProcessorBase.java:114-126 | sql/src/main/java/org/apache/druid/sql/hook/DruidHook.java:63-75 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×4
Edited copies of one member (3 members, 6+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMapping.java:90— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMapping.java:90-96 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMappingFull.java:89-95 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleSimplifiedPermissions.java:134-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) processing/src/main/java/org/apache/druid/java/util/common/parsers/ParserUtils.java:146— processing/src/main/java/org/apache/druid/java/util/common/parsers/ParserUtils.java:146-152 | processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java:543-548 | server/src/main/java/org/apache/druid/rpc/ServiceLocation.java:270-275 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) server/src/main/java/org/apache/druid/server/initialization/jetty/BadRequestExceptionMapper.java:35— server/src/main/java/org/apache/druid/server/initialization/jetty/BadRequestExceptionMapper.java:35-40 | server/src/main/java/org/apache/druid/server/initialization/jetty/HttpExceptionMapper.java:35-42 | server/src/main/java/org/apache/druid/server/initialization/jetty/ServiceUnavailableExceptionMapper.java:34-39 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/ArrayBasedIndexedInts.java:89— processing/src/main/java/org/apache/druid/segment/data/ArrayBasedIndexedInts.java:89-94 | processing/src/main/java/org/apache/druid/segment/data/RangeIndexedInts.java:52-57 | processing/src/main/java/org/apache/druid/segment/data/SliceIndexedInts.java:56-61 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×4
Edited copy of a member (3 corresponding lines) server/src/main/java/org/apache/druid/client/DataSourcesSnapshot.java:257— server/src/main/java/org/apache/druid/client/DataSourcesSnapshot.java:257-263 | server/src/main/java/org/apache/druid/client/DruidServer.java:193-195 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/SpecificSegmentLockRequest.java:69— indexing-service/src/main/java/org/apache/druid/indexing/overlord/SpecificSegmentLockRequest.java:69-71 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TimeChunkLockRequest.java:49-51 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/DefaultOperandTypeChecker.java:283— sql/src/main/java/org/apache/druid/sql/calcite/expression/DefaultOperandTypeChecker.java:283-285 | sql/src/main/java/org/apache/druid/sql/calcite/expression/OperatorConversions.java:505-507 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1748— indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1748-1750 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/WorkerSelectUtils.java:225-227 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (18–19 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:530— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:530-547 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:676-694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:530` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:377— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:377-395 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:391-408 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:377` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:107— sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:107-124 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:126-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–19 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArraySqlAggregator.java:117— sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArraySqlAggregator.java:117-134 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArraySqlAggregator.java:136-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArraySqlAggregator.java:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 3) processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:76— processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:76-88 | processing/src/main/java/org/apache/druid/frame/write/columnar/FloatFrameMaker.java:76-88 | processing/src/main/java/org/apache/druid/frame/write/columnar/LongFrameMaker.java:76-88 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java` and `processing/src/main/java/org/apache/druid/frame/write/columnar/FloatFrameMaker.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:276— processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:276-288 | processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:322-334 | processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:368-380 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:276` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:320— processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:320-332 | processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:352-364 | processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:384-396 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:320` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 3) services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:146— services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:146-158 | services/src/main/java/org/apache/druid/cli/CliOverlord.java:274-286 | services/src/main/java/org/apache/druid/cli/CliPeon.java:407-419 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CliMiddleManager.java` and `services/src/main/java/org/apache/druid/cli/CliOverlord.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:68— processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:68-73 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:134-139 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:186-191 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:78-83 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:141-146 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:180-185 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java` and `processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:778— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:778-783 | processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:861-866 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1303-1308 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1392-1397 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1479-1484 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1572-1577 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:778` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/CannotParseExternalDataFault.java:39— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/CannotParseExternalDataFault.java:39-44 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/ColumnTypeNotSupportedFault.java:71-76 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/InsertCannotBeEmptyFault.java:55-60 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/InsertTimeNullFault.java:40-45 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/InsertTimeOutOfBoundsFault.java:69-74 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/InvalidNullByteFault.java:128-133 — before extracting anything, compare `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/CannotParseExternalDataFault.java` and `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/ColumnTypeNotSupportedFault.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 6) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchObjectStrategy.java:43— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchObjectStrategy.java:43-48 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchObjectStrategy.java:68-75 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchObjectStrategy.java:43-48 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchObjectStrategy.java:68-75 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchObjectStrategy.java:43-48 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchObjectStrategy.java:68-75 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 5) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:61— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:61-65 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java:74-78 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildVectorAggregator.java:74-78 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:74-78 | processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanVectorAggregator.java:73-77 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildVectorAggregator.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:70` calls `position`, `limit` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:60` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 5) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1520— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1520-1524 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1534-1538 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1548-1552 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1562-1566 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1576-1580 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1520` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 5) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilePostAggregator.java:60— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilePostAggregator.java:60-64 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchToQuantilePostAggregator.java:58-62 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilePostAggregator.java:51-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToQuantilePostAggregator.java:51-55 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilePostAggregator.java:51-55 — before extracting anything, compare `extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilePostAggregator.java` and `extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchToQuantilePostAggregator.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 5) processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:152— processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:152-156 | processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java:155-159 | processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java:166-170 | processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java:177-181 | processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java:188-192 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Off the main sequence: druid-processing — druid-processing: abstractness 0.16, instability 0.00, distance 0.84 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
Off the main sequence: druid-sql — druid-sql: abstractness 0.10, instability 0.11, distance 0.79 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
Off the main sequence: druid-server — druid-server: abstractness 0.15, instability 0.07, distance 0.78 — zone of pain — concrete and depended on by 43 project(s), so it's rigid to change.
Off the main sequence: druid-indexing-service — druid-indexing-service: abstractness 0.15, instability 0.13, distance 0.71 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
Repeated repair: processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:191— processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is PartialSegmentFileMapperV10.createForFile at line 191), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: cache entries use self hold to avoid eviction while mounting, and other fixes (#20182)”; “fix: safer sizing for partial segment metadata header, simplify bootstrap (#20105)”; “fix: handle interrupt during partial mmap to not explode (#20053)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java:441— server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is DruidCoordinator.becomeLeader at line 441), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: Release leadership on shutdown with k8s leader election. (#20800)”; “fix: guard `dutiesRunnables` with lock in DruidCoordinator (#20408)”; “fix: In coordinator duty loop - use an immutable snapshot of retention rules per run cycle (#20063)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:955— server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is StorageLocation.reclaimHelper at line 955), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: separate storage location accounting for internal cache holds (#20150)”; “fix: more chill abandoned partial loads and safer deferred eviction of weak held entries (#20073)”; “fix: safer sizing for partial segment metadata header, simplify bootstrap (#20105)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 09:33:47 -06:00' --until='2026-11-13 09:33:47 -06:00' --full-history --no-merges -- server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Change-coupling hub: segments-view.tsx → lookups-view.tsx, services-view.tsx, tasks-view.tsx web-console/src/views/segments-view/segments-view.tsx— `web-console/src/views/segments-view/segments-view.tsx` changes together with 3 other files — `web-console/src/views/lookups-view/lookups-view.tsx`, `web-console/src/views/services-view/services-view.tsx`, `web-console/src/views/tasks-view/tasks-view.tsx` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: datasources-view.tsx → lookups-view.tsx, segments-view.tsx, services-view.tsx, tasks-view.tsx web-console/src/views/datasources-view/datasources-view.tsx— `web-console/src/views/datasources-view/datasources-view.tsx` changes together with 4 other files — `web-console/src/views/lookups-view/lookups-view.tsx`, `web-console/src/views/segments-view/segments-view.tsx`, `web-console/src/views/services-view/services-view.tsx`, `web-console/src/views/tasks-view/tasks-view.tsx` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: ControllerImpl.java → DartControllerContext.java, DartSqlEngine.java, IndexerControllerContext.java, MSQWorkerTaskLauncher.java multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java— `multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java` changes together with 4 other files — `multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/DartControllerContext.java`, `multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/sql/DartSqlEngine.java`, `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerControllerContext.java`, `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×3
Edited copy of a member (47 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1359— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1359-1405 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTuningConfig.java:157-212 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (47 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:590— indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:590-636 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:401-459 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (47 corresponding lines) extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:388— extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:388-438 | extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:446-492 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×3
Edited copy of a member (45 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:188— indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:188-233 | indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolboxFactory.java:174-218 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:189— processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:189-241 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:136-180 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramCountSqlAggregator.java:75— extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramCountSqlAggregator.java:75-123 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramPercentileSqlAggregator.java:126-170 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×3
Edited copy of a member (38 corresponding lines) server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:404— server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:404-445 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:455-492 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitter.java:109— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitter.java:109-146 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitter.java:101-148 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:125— processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:125-162 | processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:193-237 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×3
Edited copy of a member (41 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:292— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:292-332 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:304-345 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:327— processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:327-368 | processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:393-433 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:856— server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:856-896 | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:998-1043 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 25+ corresponding lines) · ×3
Edited copies of one member (3 members, 25+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:177— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:177-201 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:177-201 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:177-201 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 25+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:63— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:63-87 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java:61-85 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:72-96 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 25+ corresponding lines) extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestSketchQuantileSqlAggregator.java:174— extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestSketchQuantileSqlAggregator.java:174-198 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:228-263 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:203-231 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 21+ corresponding lines) · ×3
Edited copies of one member (5 members, 21+ corresponding lines) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregator.java:143— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregator.java:143-167 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java:208-228 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java:195-215 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleLongAggregatorFactory.java:198-218 | processing/src/main/java/org/apache/druid/query/aggregation/post/ExpressionPostAggregator.java:349-373 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 21+ corresponding lines) processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:320— processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:320-340 | processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:348-368 | processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:376-396 | processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:404-424 | processing/src/main/java/org/apache/druid/segment/virtual/NestedMergeVirtualColumn.java:432-452 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 21+ corresponding lines) processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:160— processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:160-180 | processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:192-212 | processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:266-286 | processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:318-338 | processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java:350-370 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×3
Edited copies of one member (4 members, 17+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:301— processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:301-317 | processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:330-346 | processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:406-425 | processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:444-463 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 17+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexColumn.java:97— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexColumn.java:97-114 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexColumn.java:97-114 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexColumn.java:97-114 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexColumn.java:100-116 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 17+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:457— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:457-473 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:551-567 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:606-627 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:683-699 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×3
Edited copies of one member (4 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:404— processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:404-418 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:422-436 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:648-663 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:667-682 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:78— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:78-92 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:96-110 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorFactory.java:134-148 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorFactory.java:152-166 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:44— processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:44-58 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:62-76 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:80-94 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:98-112 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 12+ corresponding lines) · ×3
Edited copies of one member (5 members, 12+ corresponding lines) extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:194— extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumn.java:194-205 | processing/src/main/java/org/apache/druid/query/filter/ExtractionDimFilter.java:83-95 | processing/src/main/java/org/apache/druid/query/filter/JavaScriptDimFilter.java:125-138 | processing/src/main/java/org/apache/druid/query/filter/RegexDimFilter.java:104-117 | processing/src/main/java/org/apache/druid/query/filter/SearchQueryDimFilter.java:104-117 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 12+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:45— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:45-56 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java:45-56 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java:52-63 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchBuildVectorAggregator.java:52-63 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildVectorAggregator.java:52-63 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 12+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:290— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:290-301 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:283-294 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:281-292 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java:284-295 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java:281-292 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 10+ corresponding lines) · ×3
Edited copies of one member (6 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:161— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:161-171 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:150-159 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:149-158 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java:137-146 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java:154-163 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastAggregatorFactory.java:153-162 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 10+ corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregatorFactory.java:305— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregatorFactory.java:305-318 | extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:309-322 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregatorFactory.java:271-282 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchAggregatorFactory.java:292-304 | processing/src/main/java/org/apache/druid/query/aggregation/SingleValueAggregatorFactory.java:173-184 | processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregatorFactory.java:210-219 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxVectorAggregator.java:44— processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxVectorAggregator.java:44-53 | processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinVectorAggregator.java:44-53 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxVectorAggregator.java:44-53 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMinVectorAggregator.java:44-53 | processing/src/main/java/org/apache/druid/query/aggregation/LongMaxVectorAggregator.java:44-53 | processing/src/main/java/org/apache/druid/query/aggregation/LongMinVectorAggregator.java:44-53 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 11+ corresponding lines) · ×3
Edited copies of one member (5 members, 11+ corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilePostAggregator.java:134— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilePostAggregator.java:134-145 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramCountPostAggregator.java:120-130 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramPercentilePostAggregator.java:132-143 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchToQuantilePostAggregator.java:129-140 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/BloomFilterAggregatorFactory.java:221-232 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 11+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToStringPostAggregator.java:126— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToStringPostAggregator.java:126-136 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToStringPostAggregator.java:117-127 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToStringPostAggregator.java:117-127 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToStringPostAggregator.java:117-127 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchToStringPostAggregator.java:121-131 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 11+ corresponding lines) extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java:201— extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogClient.java:201-215 | server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:105-120 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:185-195 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:224-234 | server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java:357-367 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×3
Edited copies of one member (4 members, 10+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/DimensionDistributionReport.java:72— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/DimensionDistributionReport.java:72-82 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/GeneratedPartitionsReport.java:67-78 | processing/src/main/java/org/apache/druid/indexer/report/KillTaskReport.java:66-75 | processing/src/main/java/org/apache/druid/indexer/report/TaskContextReport.java:68-77 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 10+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:332— sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:332-341 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidJoinQueryRel.java:268-277 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidOuterQueryRel.java:129-138 | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidUnionDataSourceRel.java:156-165 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 10+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregatorHelper.java:134— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregatorHelper.java:134-143 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/BaseBloomFilterAggregator.java:88-97 | processing/src/main/java/org/apache/druid/segment/column/NullableTypeStrategy.java:95-105 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategy.java:127-136 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×3
Edited copies of one member (3 members, 4+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:130— processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:130-133 | processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java:130-133 | processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java:130-133 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToRankPostAggregator.java:84— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToRankPostAggregator.java:84-87 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToRankPostAggregator.java:84-87 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToRankPostAggregator.java:84-87 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:172— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:172-175 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:510-513 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:586-589 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (33 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:560— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:560-592 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:722-754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:560` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (33 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:155— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:155-187 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java:156-188 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:155` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/constant/LongConstantAggregator.java:33— processing/src/main/java/org/apache/druid/query/aggregation/constant/LongConstantAggregator.java:33-65 | processing/src/main/java/org/apache/druid/query/aggregation/constant/LongConstantBufferAggregator.java:34-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (30 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/DoubleBivariateFunctionVectorProcessor.java:54— processing/src/main/java/org/apache/druid/math/expr/vector/DoubleBivariateFunctionVectorProcessor.java:54-83 | processing/src/main/java/org/apache/druid/math/expr/vector/LongBivariateFunctionVectorProcessor.java:54-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (30 lines × 2) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:508— processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:508-537 | processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java:325-354 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java` and `processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:508` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (30 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:99— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:99-128 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java:100-129 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:99` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2AutoScaler.java:261— extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2AutoScaler.java:261-288 | extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2AutoScaler.java:301-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2AutoScaler.java:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) processing/src/main/java/org/apache/druid/regex/RegexPatternFactory.java:44— processing/src/main/java/org/apache/druid/regex/RegexPatternFactory.java:44-71 | processing/src/main/java/org/apache/druid/regex/RegexPatternFactory.java:80-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/regex/RegexPatternFactory.java:44` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1041— sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1041-1068 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1160-1187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1041` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27–28 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java:53— processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java:53-80 | processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceLongVectorProcessor.java:53-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java:53` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27–28 lines × 2) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:424— processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:424-450 | processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java:429-456 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java` and `processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:424` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27–28 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:589— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:589-616 | processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:340-366 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:589` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (25 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorFactory.java:159— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorFactory.java:159-183 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchAggregatorFactory.java:159-183 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorFactory.java:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (25 lines × 2) processing/src/main/java/org/apache/druid/java/util/common/guava/SkippingSequence.java:58— processing/src/main/java/org/apache/druid/java/util/common/guava/SkippingSequence.java:58-82 | processing/src/main/java/org/apache/druid/query/scan/ScanQueryOffsetSequence.java:69-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/common/guava/SkippingSequence.java:58` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/DoubleUnivariateFunctionVectorProcessor.java:50— processing/src/main/java/org/apache/druid/math/expr/vector/DoubleUnivariateFunctionVectorProcessor.java:50-74 | processing/src/main/java/org/apache/druid/math/expr/vector/LongUnivariateFunctionVectorProcessor.java:50-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:72— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:72-95 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:72-95 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 2) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:143— processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:143-166 | processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSetUtils.java:93-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24 lines × 2) server/src/main/java/org/apache/druid/client/selector/PooledTierSelectorStrategyConfig.java:39— server/src/main/java/org/apache/druid/client/selector/PooledTierSelectorStrategyConfig.java:39-62 | server/src/main/java/org/apache/druid/client/selector/StrictTierSelectorStrategyConfig.java:39-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:171— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:171-191 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java:225-245 — before extracting anything, compare `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java` and `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:127— processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:127-147 | processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:167-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExpressionType.java:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:194— server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:194-214 | server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java:182-202 — before extracting anything, compare `server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java` and `server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:194` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:143— extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:143-160 | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java:171-187 — before extracting anything, compare `extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java` and `extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesDataSegmentPuller.java:56— extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesDataSegmentPuller.java:56-73 | extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPuller.java:95-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesDataSegmentPuller.java:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTask.java:63— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTask.java:63-79 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTask.java:76-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:185— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:185-201 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:185-201 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:185-201 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 3) processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:215— processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:215-231 | processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java:216-232 | processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java:204-220 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java` and `processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 3) processing/src/main/java/org/apache/druid/java/util/common/guava/FilteredSequence.java:61— processing/src/main/java/org/apache/druid/java/util/common/guava/FilteredSequence.java:61-77 | processing/src/main/java/org/apache/druid/java/util/common/guava/SkippingSequence.java:56-72 | processing/src/main/java/org/apache/druid/query/scan/ScanQueryOffsetSequence.java:67-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/common/guava/FilteredSequence.java:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `accumulator` to `FilteringYieldingAccumulator<OutType, T>` in one and `SkippingYieldingAccumulator<OutType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15–17 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2309— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2309-2323 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2383-2399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2383` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–17 lines × 2) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1482— server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1482-1498 | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1619-1633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1482` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–17 lines × 2) services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java:96— services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java:96-112 | services/src/main/java/org/apache/druid/cli/MiddleManagerJettyServerInitializer.java:81-95 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java` and `services/src/main/java/org/apache/druid/cli/MiddleManagerJettyServerInitializer.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:86— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:86-101 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java:86-101 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java:86-101 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToHistogramPostAggregator.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToHistogramPostAggregator.java:86` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 3) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:65— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:65-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java:65-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongSubProcessor.java:65-80 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:568— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:568-583 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:607-622 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:714-729 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:568` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–16 lines × 2) extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestGenerateSketchSqlAggregator.java:124— extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestGenerateSketchSqlAggregator.java:124-137 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestSketchQuantileSqlAggregator.java:143-158 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestSketchQuantileSqlAggregator.java:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–16 lines × 2) server/src/main/java/org/apache/druid/client/selector/CustomTierSelectorStrategy.java:60— server/src/main/java/org/apache/druid/client/selector/CustomTierSelectorStrategy.java:60-73 | server/src/main/java/org/apache/druid/client/selector/StrictTierSelectorStrategy.java:94-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/client/selector/CustomTierSelectorStrategy.java:60` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–16 lines × 2) server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:446— server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:446-461 | server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java:494-507 — before extracting anything, compare `server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java` and `server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:443` calls `GuardedBy` and `server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java:490` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 3) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:195— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:195-208 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:336-349 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:369-382 — before extracting anything, compare `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java` and `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:195` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 3) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:308— multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:308-321 | multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:394-407 | multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:451-464 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:151— processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:151-164 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:148-161 | processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java:201-214 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java` and `processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Cpu.java:62— processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Cpu.java:62-75 | processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/CpuV2.java:66-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Cpu.java:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/CpuV2.java:80` calls `tryParse` and `processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Cpu.java:76` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–14 lines × 2) processing/src/main/java/org/apache/druid/math/expr/Function.java:3727— processing/src/main/java/org/apache/druid/math/expr/Function.java:3727-3739 | processing/src/main/java/org/apache/druid/math/expr/Function.java:3768-3781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/Function.java:3727` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransaction.java:369— server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransaction.java:369-382 | server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransaction.java:405-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransaction.java:369` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchObjectSqlAggregator.java:95— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchObjectSqlAggregator.java:95-106 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:96-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchObjectSqlAggregator.java:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogs.java:134— indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogs.java:134-145 | server/src/main/java/org/apache/druid/server/log/FileRequestLogger.java:173-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogs.java:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2252— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2252-2262 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2901-2912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 4) processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:97— processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:97-107 | processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:138-148 | processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:172-182 | processing/src/main/java/org/apache/druid/segment/column/ColumnType.java:171-181 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:97` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `other` to `ExpressionType` in one and `ColumnType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 4) processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:274— processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:274-284 | processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:303-313 | processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:332-342 | processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:367-377 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java:274` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:72— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:72-82 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java:70-80 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarLongsSupplier.java:85-95 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:81-91 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java` and `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–9 lines × 2) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:415— processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:415-423 | processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:426-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:182— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:182-190 | processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java:153-160 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java` and `processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 2) processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:272— processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:272-280 | processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:313-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC2 · Forms & labels· <SegmentedControl> field component without a label · ×2
<SegmentedControl> field component without a label web-console/src/components/auto-form/auto-form.tsx:388— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<SegmentedControl> field component without a label web-console/src/views/explore-view/components/control-pane/control-pane.tsx:95— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×2
Focus outline removed in CSS without a :focus replacement website/static/css/code-block-buttons.css:35— `pre .copyCodeButton:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement web-console/src/entry.scss:52— `body.mouse-mode *:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×2
Animation without a prefers-reduced-motion guard web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.scss:87— `.recent-query-task-panel .work-entries .work-entry .line1 .status-icon.running svg` moves (`animation-name: spin`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.scss:84— `.current-dart-panel .work-entries .work-entry .line1 .status-icon.running svg` moves (`animation-name: spin`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
generic-output-table.GenericOutputTable::getHeaderMenu (cognitive 33) web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:151— generic-output-table.GenericOutputTable::getHeaderMenu has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 2 (8 pts), boolean chains 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (generic-output-table.GenericOutputTable::getCellMenu) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
generic-output-table.GenericOutputTable::getCellMenu (cognitive 22) web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:295— generic-output-table.GenericOutputTable::getCellMenu has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (generic-output-table.GenericOutputTable::getHeaderMenu) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Change coupling clique: CliOverlord.java, CoordinatorJettyServerInitializer.java, MiddleManagerJettyServerInitializer.java, QueryJettyServerInitializer.java, RouterJettyServerInitializer.java services/src/main/java/org/apache/druid/cli/CliOverlord.java— 5 files — `services/src/main/java/org/apache/druid/cli/CliOverlord.java`, `services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java`, `services/src/main/java/org/apache/druid/cli/MiddleManagerJettyServerInitializer.java`, `services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java`, `services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java` — all change together with no explicit dependency: a fully-connected co-change clique, not 10 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change coupling clique: HeapMemoryTaskStorage.java, MetadataTaskStorage.java, TaskQueryTool.java indexing-service/src/main/java/org/apache/druid/indexing/overlord/HeapMemoryTaskStorage.java— 3 files — `indexing-service/src/main/java/org/apache/druid/indexing/overlord/HeapMemoryTaskStorage.java`, `indexing-service/src/main/java/org/apache/druid/indexing/overlord/MetadataTaskStorage.java`, `indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueryTool.java` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication· Members sharing a duplicated core (12 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (12 members, 50+ identical tokens) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:333— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:333-366 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:654-670 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:673-689 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:692-708 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:711-727 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:730-746 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:749-765 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:768-784 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:787-803 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:806-825 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:828-846 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:849-865 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
Members sharing a duplicated core (12 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:70— processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:70-99 | processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:77-97 | processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:104-136 | processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:113-134 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:72-102 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:79-100 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:106-138 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:115-136 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:71-101 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:78-99 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:105-137 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:114-135 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:306— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:306-313 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:299-306 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:139-146 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java:187-194 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialHashSegmentGenerateTask.java:135-142 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialRangeSegmentGenerateTask.java:153-160 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTask.java:197-204 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/segment/index/IndexedStringDruidPredicateIndexes.java:61— processing/src/main/java/org/apache/druid/segment/index/IndexedStringDruidPredicateIndexes.java:61-101 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:649-692 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:943-991 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1223-1271 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1459-1533 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:569-613 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:593-638 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchUtils.java:81— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchUtils.java:81-96 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchUtils.java:90-105 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:94-204 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:75-223 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:77-198 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1519— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1519-1527 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1533-1541 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1547-1555 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1561-1569 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1575-1583 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (65 corresponding lines) · ×2
Edited copy of a member (65 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1869— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1869-1933 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1944-2021 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (65 corresponding lines) processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java:328— processing/src/main/java/org/apache/druid/query/search/SearchQueryQueryToolChest.java:328-392 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:620-690 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×2
Edited copy of a member (53 corresponding lines) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:472— multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:472-524 | multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlTaskResource.java:252-308 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (53 corresponding lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:1170— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:1170-1225 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:1721-1773 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×2
Edited copy of a member (56 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java:73— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java:73-147 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java:157-212 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (56 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:148— processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:148-206 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSupplier.java:216-271 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (61 corresponding lines) · ×2
Edited copy of a member (61 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:305— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:305-365 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:305-379 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (61 corresponding lines) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/expressions/BloomFilterExpressions.java:108— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/expressions/BloomFilterExpressions.java:108-168 | processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java:135-203 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (48 corresponding lines) · ×2
Edited copy of a member (48 corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:82— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:82-129 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:92-141 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (48 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:702— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:702-750 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1001-1048 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 66+ corresponding lines) · ×2
Edited copies of one member (3 members, 66+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:161— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:161-226 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:161-226 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:160-225 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 66 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 66+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:157— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:157-222 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:152-217 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:163-228 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 66 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 31+ corresponding lines) · ×2
Edited copies of one member (3 members, 31+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java:42— processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java:42-82 | processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceLongVectorProcessor.java:42-81 | processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceVectorObjectProcessor.java:41-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 31+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:192— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:192-222 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:192-222 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:191-221 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×2
Edited copy of a member (54 corresponding lines) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:473— processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:473-537 | processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java:301-354 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (54 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/BoundDimFilter.java:454— processing/src/main/java/org/apache/druid/query/filter/BoundDimFilter.java:454-514 | processing/src/main/java/org/apache/druid/query/filter/BoundDimFilter.java:517-570 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 40+ corresponding lines) · ×2
Edited copies of one member (3 members, 40+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:757— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:757-800 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1055-1097 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:372-411 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 40+ corresponding lines) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:288— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:288-335 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:405-444 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:480-521 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×2
Edited copy of a member (39 corresponding lines) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:70— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:70-108 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:307-353 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstBufferAggregator.java:66— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstBufferAggregator.java:66-104 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/StringLastBufferAggregator.java:66-104 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 32+ corresponding lines) · ×2
Edited copies of one member (3 members, 32+ corresponding lines) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:339— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:339-371 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:448-480 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:525-556 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 32+ corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchComplexMetricSerde.java:42— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchComplexMetricSerde.java:42-77 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramComplexMetricSerde.java:51-82 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchComplexMetricSerde.java:41-74 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 28+ corresponding lines) · ×2
Edited copies of one member (3 members, 28+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FixedIndexed.java:189— processing/src/main/java/org/apache/druid/segment/data/FixedIndexed.java:189-216 | processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:198-225 | processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:673-700 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 28+ corresponding lines) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorIOConfig.java:170— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorIOConfig.java:170-198 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTuningConfig.java:102-129 | server/src/main/java/org/apache/druid/server/initialization/ServerConfig.java:90-118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 24+ corresponding lines) · ×2
Edited copies of one member (5 members, 24+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:40— processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:40-64 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java:40-64 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/LongCardinalityVectorProcessor.java:40-64 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java:41-68 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/SingleValueStringCardinalityVectorProcessor.java:40-63 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 24+ corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:268— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:268-291 | extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:214-243 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java:176-199 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:193-218 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskTuningConfig.java:340-368 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 37+ corresponding lines) · ×2
Edited copies of one member (3 members, 37+ corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:107— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:107-143 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:106-143 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:121-169 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 37+ corresponding lines) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:399— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:399-435 | processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:439-476 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:767-810 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 16+ corresponding lines) · ×2
Edited copies of one member (7 members, 16+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMapping.java:66— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMapping.java:66-86 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerGroupMappingFull.java:65-85 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRole.java:69-84 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerRoleSimplifiedPermissions.java:112-130 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUser.java:57-72 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUserFull.java:61-76 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/entity/BasicAuthorizerUserFullSimplifiedPermissions.java:57-72 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
Edited copies of one member (7 members, 16+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchConstantPostAggregator.java:112— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchConstantPostAggregator.java:112-127 | processing/src/main/java/org/apache/druid/query/aggregation/post/ConstantPostAggregator.java:108-127 | processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java:136-154 | processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java:136-154 | processing/src/main/java/org/apache/druid/query/aggregation/post/FieldAccessPostAggregator.java:149-167 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java:136-154 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java:136-154 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 22+ corresponding lines) · ×2
Edited copies of one member (4 members, 22+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:69— processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:69-92 | processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:96-122 | processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:126-151 | processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:155-176 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 22+ corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentKiller.java:86— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentKiller.java:86-107 | extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentKiller.java:141-166 | extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleDataSegmentKiller.java:124-147 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentKiller.java:211-232 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 25+ corresponding lines) · ×2
Edited copies of one member (4 members, 25+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:159— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java:159-183 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java:151-175 | processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarIntsSupplier.java:347-373 | processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarIntsSupplier.java:377-403 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 25+ corresponding lines) processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:284— processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:284-308 | processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:316-340 | processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:348-372 | processing/src/main/java/org/apache/druid/segment/virtual/NestedObjectVirtualColumn.java:380-404 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregatorFactory.java:80— extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/max/CompressedBigDecimalMaxAggregatorFactory.java:80-102 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/min/CompressedBigDecimalMinAggregatorFactory.java:86-108 | extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/aggregator/sum/CompressedBigDecimalSumAggregatorFactory.java:84-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:135— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:135-157 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:135-157 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:134-156 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×2
Edited copies of one member (4 members, 9+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/FilteredVectorInputBinding.java:84— processing/src/main/java/org/apache/druid/math/expr/vector/FilteredVectorInputBinding.java:84-92 | processing/src/main/java/org/apache/druid/math/expr/vector/FilteredVectorInputBinding.java:96-104 | processing/src/main/java/org/apache/druid/math/expr/vector/FilteredVectorInputBinding.java:108-116 | processing/src/main/java/org/apache/druid/math/expr/vector/FilteredVectorInputBinding.java:121-132 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:120— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:120-128 | extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeBufferAggregator.java:90-100 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregateHelper.java:113-122 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchBufferAggregator.java:116-124 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×2
Edited copies of one member (4 members, 20+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastUtils.java:68— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastUtils.java:68-91 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastUtils.java:100-123 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastUtils.java:131-154 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/StringFirstLastUtils.java:46-65 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 20+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerde.java:127— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerde.java:127-146 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexMetricSerde.java:128-147 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexMetricSerde.java:127-146 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerde.java:175-194 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 14+ corresponding lines) · ×2
Edited copies of one member (6 members, 14+ corresponding lines) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java:32— extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanAverager.java:32-47 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleMeanNoNullAverager.java:32-45 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/DoubleSumAverager.java:31-44 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanAverager.java:32-47 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongMeanNoNullAverager.java:32-45 | extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/averagers/LongSumAverager.java:31-44 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 14+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/CoordinatorBasicAuthenticatorResourceHandler.java:148— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/endpoint/CoordinatorBasicAuthenticatorResourceHandler.java:148-161 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:279-292 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:296-309 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:313-326 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:330-343 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/CoordinatorBasicAuthorizerResourceHandler.java:347-360 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×2
Edited copies of one member (4 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleProcessor.java:53— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleProcessor.java:53-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongProcessor.java:56-62 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleProcessor.java:56-62 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongProcessor.java:54-60 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:504— indexing-service/src/main/java/org/apache/druid/indexing/compact/OverlordCompactionScheduler.java:504-514 | server/src/main/java/org/apache/druid/server/coordinator/DruidCoordinator.java:768-775 | server/src/main/java/org/apache/druid/server/http/BaseDynamicConfigSyncer.java:269-275 | server/src/main/java/org/apache/druid/server/metrics/TaskCountStatsMonitor.java:80-90 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×2
Edited copies of one member (4 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java:49— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java:49-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java:64-72 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java:80-88 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdProcessors.java:96-104 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/JavaScriptDimFilter.java:75— processing/src/main/java/org/apache/druid/query/filter/JavaScriptDimFilter.java:75-83 | processing/src/main/java/org/apache/druid/query/filter/RegexDimFilter.java:59-67 | processing/src/main/java/org/apache/druid/query/filter/SearchQueryDimFilter.java:55-63 | processing/src/main/java/org/apache/druid/query/filter/SpatialDimFilter.java:53-60 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 9+ corresponding lines) · ×2
Edited copies of one member (5 members, 9+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:59— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:59-67 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilesPostAggregator.java:84-92 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToCDFPostAggregator.java:59-67 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToCDFPostAggregator.java:59-67 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilesPostAggregator.java:84-92 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 9+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/rule/AggregateMergeRule.java:342— sql/src/main/java/org/apache/druid/sql/calcite/rule/AggregateMergeRule.java:342-351 | sql/src/main/java/org/apache/druid/sql/calcite/rule/CaseToCoalesceRule.java:60-70 | sql/src/main/java/org/apache/druid/sql/calcite/rule/CoalesceLookupRule.java:47-57 | sql/src/main/java/org/apache/druid/sql/calcite/rule/RewriteFirstValueLastValueRule.java:63-73 | sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidAggregateRemoveRedundancyRule.java:80-88 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 3+ corresponding lines) · ×2
Edited copies of one member (5 members, 3+ corresponding lines) extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountAggregatorFactory.java:110— extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/DistinctCountAggregatorFactory.java:110-112 | processing/src/main/java/org/apache/druid/query/aggregation/LongMaxAggregator.java:29-31 | processing/src/main/java/org/apache/druid/query/aggregation/LongMinAggregator.java:29-31 | processing/src/main/java/org/apache/druid/query/aggregation/LongSumAggregator.java:36-38 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:296-298 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 3+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregator.java:29— processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregator.java:29-31 | processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinAggregator.java:29-31 | processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumAggregator.java:36-38 | REDACTED:126-129 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:447-449 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Duplicated block (52 lines × 2) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:297— extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java:297-348 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java:204-255 — before extracting anything, compare `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/data/input/kafkainput/KafkaInputReader.java` and `extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/data/input/kinesis/KinesisInputReader.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (52 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/NoopDoublesSketchAggregator.java:1— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/NoopDoublesSketchAggregator.java:1-52 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/NoopDoublesSketchBufferAggregator.java:1-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/NoopDoublesSketchAggregator.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (45 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:280— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:280-324 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:409-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:280` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (45 lines × 2) processing/src/main/java/org/apache/druid/query/search/BySegmentSearchResultValue.java:44— processing/src/main/java/org/apache/druid/query/search/BySegmentSearchResultValue.java:44-88 | processing/src/main/java/org/apache/druid/query/topn/BySegmentTopNResultValue.java:45-90 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/search/BySegmentSearchResultValue.java` and `processing/src/main/java/org/apache/druid/query/topn/BySegmentTopNResultValue.java` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (34 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:238— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:238-271 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:367-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (34 lines × 2) extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramIndexBasedComplexColumn.java:32— extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramIndexBasedComplexColumn.java:32-65 | processing/src/main/java/org/apache/druid/segment/column/GenericIndexedBasedComplexColumn.java:37-70 — before extracting anything, compare `extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramIndexBasedComplexColumn.java` and `processing/src/main/java/org/apache/druid/segment/column/GenericIndexedBasedComplexColumn.java` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `index` to `SpectatorHistogramIndexed` in one and `GenericIndexed<?>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (30–32 lines × 2) processing/src/main/java/org/apache/druid/query/topn/TopNLexicographicResultBuilder.java:84— processing/src/main/java/org/apache/druid/query/topn/TopNLexicographicResultBuilder.java:84-113 | processing/src/main/java/org/apache/druid/query/topn/TopNNumericResultBuilder.java:104-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/topn/TopNLexicographicResultBuilder.java:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30–32 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:839— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:839-868 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:970-1001 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:839` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:837` calls `incrementMergedRows`, `setMergeCpuTime`, `safeGetThreadCpuTime` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:970` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (28–29 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:484— indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:484-512 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:288-315 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:484` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–29 lines × 2) indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:433— indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:433-460 | indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:479-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:433` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (26 lines × 3) extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java:50— extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java:50-75 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java:50-75 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregator.java:50-75 — before extracting anything, compare `extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java` and `extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java:50` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 3) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:139— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:139-164 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:594-619 | processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:347-372 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java` and `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:139` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (24 lines × 3) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:331— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:331-354 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:440-463 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:517-540 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:331` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 3) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:103— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:103-126 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:98-121 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:109-132 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22–23 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:565— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:565-586 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:604-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:565` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22–23 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/StringSqlAggregator.java:157— sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/StringSqlAggregator.java:157-178 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/StringSqlAggregator.java:180-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/StringSqlAggregator.java:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (20–22 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:840— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:840-861 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:948-967 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:840` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (20–22 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1560— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1560-1581 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1656-1675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20–21 lines × 2) indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:534— indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:534-553 | indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:567-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java:534` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (20–21 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:333— processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:333-353 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:422-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 3) extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:714— extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:714-732 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:738-756 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:953-971 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:714` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 3) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/LeftOperatorConversion.java:58— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/LeftOperatorConversion.java:58-76 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RepeatOperatorConversion.java:58-76 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RightOperatorConversion.java:58-76 — before extracting anything, compare `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/LeftOperatorConversion.java` and `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RepeatOperatorConversion.java` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17–19 lines × 2) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:121— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:121-137 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:573-591 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java` and `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–19 lines × 2) server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:246— server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:246-264 | server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:301-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 3) processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:82— processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:82-99 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:85-102 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:84-101 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java` and `processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:82` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) processing/src/main/java/org/apache/druid/query/rowsandcols/column/DoubleArrayColumn.java:54— processing/src/main/java/org/apache/druid/query/rowsandcols/column/DoubleArrayColumn.java:54-71 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/IntArrayColumn.java:54-71 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/LongArrayColumn.java:54-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/rowsandcols/column/DoubleArrayColumn.java:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 4) extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java:308— extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java:308-322 | extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/mysql/MySQLConnector.java:296-310 | extensions-core/postgresql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/postgresql/PostgreSQLConnector.java:326-340 | server/src/main/java/org/apache/druid/metadata/storage/derby/DerbyConnector.java:193-207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 4) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:513— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:513-527 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:874-888 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1171-1185 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1429-1443 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:513` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:136— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:136-149 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:161-175 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:123-137 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 3) processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java:150— processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java:150-164 | processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java:148-161 | processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerdeV2.java:150-163 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java` and `processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java:150` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 3) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryStageProcessor.java:121— multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryStageProcessor.java:121-135 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPostShuffleStageProcessor.java:87-101 | multi-stage-query/src/main/java/org/apache/druid/msq/querykit/results/QueryResultStageProcessor.java:72-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (15 lines × 3) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnSerializer.java:111— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnSerializer.java:111-127 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnSerializer.java:113-127 | processing/src/main/java/org/apache/druid/segment/nested/ScalarStringColumnSerializer.java:96-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (14 lines × 4) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:67— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:67-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:69-82 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:67-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:67-80 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 4) processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleDeltaEncodedStagedSerde.java:40— processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleDeltaEncodedStagedSerde.java:40-53 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongFloatDeltaEncodedStagedSerde.java:40-53 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongLongDeltaEncodedStagedSerde.java:40-53 | processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringDeltaEncodedStagedSerde.java:106-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (12–14 lines × 2) processing/src/main/java/org/apache/druid/frame/segment/columnar/ColumnarFrameCursorFactory.java:139— processing/src/main/java/org/apache/druid/frame/segment/columnar/ColumnarFrameCursorFactory.java:139-152 | processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorHolder.java:188-199 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12–14 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlInsert.java:117— sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlInsert.java:117-128 | sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlReplace.java:133-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 4) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:772— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:772-784 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:791-803 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:810-825 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:832-846 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:772` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 4) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:110— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:110-122 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:105-117 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:116-128 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:707-719 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java` and `processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–13 lines × 3) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:110— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:110-120 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:118-128 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:145-157 — before extracting anything, compare `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java` and `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 3) sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeCoalesceRule.java:59— sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeCoalesceRule.java:59-71 | sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRule.java:62-74 | sql/src/main/java/org/apache/druid/sql/calcite/rule/ReverseLookupRule.java:130-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeCoalesceRule.java:59` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–13 lines × 2) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java:365— processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java:365-373 | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/VectorGroupByEngine.java:458-470 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java:365` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9–13 lines × 2) processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorFactory.java:157— processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorFactory.java:157-169 | processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorFactory.java:334-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorFactory.java:157` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 6) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:354— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:354-364 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:772-782 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:791-801 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:810-821 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:832-842 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:853-863 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:354` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 6) processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java:85— processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java:85-95 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java:102-112 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java:75-85 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java:92-102 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleLongAggregatorFactory.java:81-91 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleLongAggregatorFactory.java:98-108 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:204— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:204-213 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapter.java:195-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:204` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10–11 lines × 2) server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java:597— server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java:597-606 | server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java:608-618 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java:597` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–10 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:307— indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:307-313 | indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:324-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java:307` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–10 lines × 2) processing/src/main/java/org/apache/druid/frame/write/columnar/NumericArrayFrameColumnWriter.java:143— processing/src/main/java/org/apache/druid/frame/write/columnar/NumericArrayFrameColumnWriter.java:143-149 | processing/src/main/java/org/apache/druid/frame/write/columnar/StringFrameColumnWriter.java:141-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/write/columnar/NumericArrayFrameColumnWriter.java:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 7) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:71— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:71-78 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:73-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:71-78 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:71-78 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:71-78 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java:71-78 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongSubProcessor.java:71-78 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 7) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicSecurityAuthenticationException.java:31— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicSecurityAuthenticationException.java:31-38 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicSecurityDBResourceException.java:31-38 | processing/src/main/java/org/apache/druid/java/util/common/IAE.java:27-34 | processing/src/main/java/org/apache/druid/java/util/common/IOE.java:29-36 | processing/src/main/java/org/apache/druid/segment/SegmentValidationException.java:30-37 | processing/src/main/java/org/apache/druid/segment/loading/SegmentLoadingException.java:34-45 | server/src/main/java/org/apache/druid/rpc/RpcException.java:32-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times.
Duplicated block (8 lines × 5) services/src/main/java/org/apache/druid/cli/CliOverlord.java:546— services/src/main/java/org/apache/druid/cli/CliOverlord.java:546-553 | services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java:81-88 | services/src/main/java/org/apache/druid/cli/MiddleManagerJettyServerInitializer.java:70-77 | services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java:124-131 | services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java:119-126 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CliOverlord.java` and `services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java:80` calls `getInstance` and `services/src/main/java/org/apache/druid/cli/CliOverlord.java:544` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 5) processing/src/main/java/org/apache/druid/segment/index/IndexedStringDictionaryEncodedStringValueIndex.java:75— processing/src/main/java/org/apache/druid/segment/index/IndexedStringDictionaryEncodedStringValueIndex.java:75-82 | processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:228-235 | processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java:160-167 | processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:345-352 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:218-225 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java` and `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–8 lines × 2) processing/src/main/java/org/apache/druid/query/rowsandcols/MapOfColumnsRowsAndColumns.java:101— processing/src/main/java/org/apache/druid/query/rowsandcols/MapOfColumnsRowsAndColumns.java:101-107 | processing/src/main/java/org/apache/druid/query/rowsandcols/MapOfColumnsRowsAndColumns.java:121-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/rowsandcols/MapOfColumnsRowsAndColumns.java:101` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7–8 lines × 2) processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:298— processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:298-304 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:320-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 7) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:307— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:307-313 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:300-306 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTask.java:140-146 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java:188-194 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialHashSegmentGenerateTask.java:136-142 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialRangeSegmentGenerateTask.java:154-160 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTask.java:198-204 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 7) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:53— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:53-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:55-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:53-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:53-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:53-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java:53-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongSubProcessor.java:53-59 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 2) extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardEmitter.java:102— extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardEmitter.java:102-107 | extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/StatsDEmitter.java:117-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6–7 lines × 2) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1283— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1283-1289 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1356-1361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 4) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchTTestPostAggregator.java:99— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchTTestPostAggregator.java:99-107 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToMeansPostAggregator.java:58-66 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToMetricsSumEstimatePostAggregator.java:61-69 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToVariancesPostAggregator.java:58-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchToMeansPostAggregator.java:67` calls `getNumValues`, `setAll`, `getMean` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchTTestPostAggregator.java:108` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 4) processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSerializer.java:124— processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSerializer.java:124-132 | processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSerializer.java:124-132 | processing/src/main/java/org/apache/druid/segment/data/CompressedColumnarIntsSerializer.java:141-149 | processing/src/main/java/org/apache/druid/segment/data/CompressedVSizeColumnarIntsSerializer.java:187-195 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSerializer.java` and `processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSerializer.java` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (41 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchComplexMetricSerde.java:49— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchComplexMetricSerde.java:49-89 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchComplexMetricSerde.java:49-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (41 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/NoopAggregator.java:27— processing/src/main/java/org/apache/druid/query/aggregation/NoopAggregator.java:27-67 | processing/src/main/java/org/apache/druid/query/aggregation/NoopBufferAggregator.java:29-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (46 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstBufferAggregator.java:35— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstBufferAggregator.java:35-80 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastBufferAggregator.java:35-80 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstBufferAggregator.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastBufferAggregator.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (46 lines × 2) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstBufferAggregator.java:35— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstBufferAggregator.java:35-80 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastBufferAggregator.java:36-81 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstBufferAggregator.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastBufferAggregator.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 8) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilesPostAggregator.java:157— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilesPostAggregator.java:157-164 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramPercentilesPostAggregator.java:119-126 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchToQuantilesPostAggregator.java:152-159 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToCDFPostAggregator.java:145-152 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilesPostAggregator.java:143-150 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToQuantilesPostAggregator.java:143-150 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToCDFPostAggregator.java:145-152 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilesPostAggregator.java:143-150 — before extracting anything, compare `extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilesPostAggregator.java` and `extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchToQuantilesPostAggregator.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 8) processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregatorFactory.java:48— processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregatorFactory.java:48-55 | processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinAggregatorFactory.java:48-55 | processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumAggregatorFactory.java:48-55 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxAggregatorFactory.java:48-55 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMinAggregatorFactory.java:48-55 | processing/src/main/java/org/apache/druid/query/aggregation/FloatSumAggregatorFactory.java:48-55 | processing/src/main/java/org/apache/druid/query/aggregation/LongMaxAggregatorFactory.java:48-55 | processing/src/main/java/org/apache/druid/query/aggregation/LongMinAggregatorFactory.java:48-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 call sites, so a change lands once.
Duplicated block (10 lines × 5) extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/reporters/DropwizardJMXReporter.java:62— extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/reporters/DropwizardJMXReporter.java:62-71 | extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124SubjectAndIdConverter.java:82-94 | processing/src/main/java/org/apache/druid/segment/filter/ColumnComparisonFilter.java:151-160 | processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java:173-182 | processing/src/main/java/org/apache/druid/segment/filter/NotFilter.java:156-165 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 5) processing/src/main/java/org/apache/druid/timeline/partition/IntegerPartitionChunk.java:103— processing/src/main/java/org/apache/druid/timeline/partition/IntegerPartitionChunk.java:103-112 | processing/src/main/java/org/apache/druid/timeline/partition/LinearPartitionChunk.java:81-90 | processing/src/main/java/org/apache/druid/timeline/partition/NumberedPartitionChunk.java:110-119 | processing/src/main/java/org/apache/druid/timeline/partition/StringPartitionChunk.java:114-123 | processing/src/main/java/org/apache/druid/timeline/partition/TombstonePartitionedChunk.java:81-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/timeline/partition/LinearPartitionChunk.java:79` calls `SuppressWarnings` and `processing/src/main/java/org/apache/druid/timeline/partition/IntegerPartitionChunk.java:101` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
R10 · Code Duplication· Duplicated block with local edits (58 matched lines × 2 locations) · ×2
Duplicated block with local edits (58 matched lines × 2 locations) web-console/src/components/show-json-or-stages/show-json-or-stages.tsx:34— web-console/src/components/show-json-or-stages/show-json-or-stages.tsx:34 · web-console/src/components/show-json/show-json.tsx:32 — the two spans are one implementation copied and then locally edited — 329 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (58 matched lines × 2 locations) web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:58— web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx:58 · web-console/src/views/workbench-view/column-tree/column-tree-menu/time-menu-items/time-menu-items.tsx:108 — the two spans are one implementation copied and then locally edited — 323 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (22 lines × 2 locations) web-console/src/druid-models/compaction-config/compaction-config.tsx:112— web-console/src/druid-models/compaction-config/compaction-config.tsx:112 · web-console/src/druid-models/compaction-config/compaction-config.tsx:141 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (22 lines × 2 locations) web-console/src/views/segments-view/segments-view.tsx:394— web-console/src/views/segments-view/segments-view.tsx:394 · web-console/src/views/supervisors-view/supervisors-view.tsx:337 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Boundary violation [package:test-suite-dependency] web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts:39— web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts:39 imports web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:test-suite-dependency] web-console/src/views/workbench-view/run-panel/run-panel.tsx:42— web-console/src/views/workbench-view/run-panel/run-panel.tsx:42 imports web-console/src/dialogs/index-spec-dialog/index-spec-dialog.tsx, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
X18 · Disposal-pattern correctness· Disposable created and abandoned in the function that made it · ×2
Disposable created and abandoned in the function that made it processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:761— `headerOut` is a `new HeapByteBufferWriteOutBytes(…)`, which holds something that has to be given back, and it is created here (line 761). Every use of it in this block calls a member through it — it is never returned, never stored, never handed to anything else, no view of it is handed on, it is not captured by a lambda or an anonymous class, and it is never released — so this block both creates the value and is the last thing that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it. Declare it in a try-with-resources (`try (HeapByteBufferWriteOutBytes headerOut = …)`), which releases it on every path including a throw, or call `headerOut.close()` in a `finally`.
Disposable created and abandoned in the function that made it processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarMultiInts.java:68— `headerBytes` is a `new HeapByteBufferWriteOutBytes(…)`, which holds something that has to be given back, and it is created here (line 68). Every use of it in this block calls a member through it — it is never returned, never stored, never handed to anything else, no view of it is handed on, it is not captured by a lambda or an anonymous class, and it is never released — so this block both creates the value and is the last thing that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it. Declare it in a try-with-resources (`try (HeapByteBufferWriteOutBytes headerBytes = …)`), which releases it on every path including a throw, or call `headerBytes.close()` in a `finally`.
AC2 · Forms & labels· <Select> field component without a label · ×1
<Select> field component without a label web-console/src/components/segment-timeline/segment-timeline.tsx:201— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark web-console/unified-console.html:20— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Low contrast colour pair in CSS (2.9:1) web-console/unified-console.html:34— `#browser-update` sets color: #ffffff on background-color: #d9822b — 2.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
schema-step.SchemaStep (cyclomatic 98) web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:265— schema-step.SchemaStep has cyclomatic complexity 98 (threshold 15). Of this number, 68 points are the body's own statements and 30 belong to 17 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
segment-bar-chart-render.SegmentBarChartRender (cyclomatic 94) web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:201— segment-bar-chart-render.SegmentBarChartRender has cyclomatic complexity 94 (threshold 15). Of this number, 29 points are the body's own statements and 65 belong to 18 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
continuous-chart-render.ContinuousChartRender (cyclomatic 75) web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx:150— continuous-chart-render.ContinuousChartRender has cyclomatic complexity 75 (threshold 15). Of this number, 25 points are the body's own statements and 50 belong to 16 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
console-table.ConsoleTable (cyclomatic 74) web-console/src/components/console-table/console-table.tsx:347— console-table.ConsoleTable has cyclomatic complexity 74 (threshold 15). Of this number, 19 points are the body's own statements and 55 belong to 17 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
SeekableStreamIndexTaskRunner.runInternal (cyclomatic 71) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:426— SeekableStreamIndexTaskRunner.runInternal has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Expressions.toSimpleLeafFilter (cyclomatic 69) sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:516— Expressions.toSimpleLeafFilter has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
query-tab.QueryTab (cyclomatic 64) web-console/src/views/workbench-view/query-tab/query-tab.tsx:108— query-tab.QueryTab has cyclomatic complexity 64 (threshold 15). Of this number, 18 points are the body's own statements and 46 belong to 14 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatasourcesView.renderDatasourcesTable (cyclomatic 63) web-console/src/views/datasources-view/datasources-view.tsx:1177— DatasourcesView.renderDatasourcesTable has cyclomatic complexity 63 (threshold 15). Of this number, 17 points are the body's own statements and 46 belong to 20 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
generic-output-table.GenericOutputTable (cyclomatic 53) web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:118— generic-output-table.GenericOutputTable has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 9 of the 53 points are its own statements and the rest belongs to 9 function items inside it that branch (getHeaderMenu, getCellMenu, a function literal at line 436, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SegmentMetadataQueryQueryToolChest.mergeAnalyses (cyclomatic 48) processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java:267— SegmentMetadataQueryQueryToolChest.mergeAnalyses has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CombineAndSimplifyBounds.doSimplify (cyclomatic 47) sql/src/main/java/org/apache/druid/sql/calcite/filtration/CombineAndSimplifyBounds.java:123— CombineAndSimplifyBounds.doSimplify has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ColumnTree.getDerivedStateFromProps (cyclomatic 46) web-console/src/views/workbench-view/column-tree/column-tree.tsx:213— ColumnTree.getDerivedStateFromProps has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 11 of the 46 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 261, 482, 236, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
check-licenses.check_licenses (cyclomatic 44) distribution/bin/check-licenses.py:475— check-licenses.check_licenses has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run-panel.RunPanel (cyclomatic 44) web-console/src/views/workbench-view/run-panel/run-panel.tsx:184— run-panel.RunPanel has cyclomatic complexity 44 (threshold 15). Of this number, 39 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
continuous-chart-single-render.ContinuousChartSingleRender (cyclomatic 43) web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-single-render.tsx:70— continuous-chart-single-render.ContinuousChartSingleRender has cyclomatic complexity 43 (threshold 15). Of this number, 18 points are the body's own statements and 25 belong to 11 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
7383.call (cyclomatic 42) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:179— 7383.call has cyclomatic complexity 42 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ParquetGroupConverter.convertPrimitiveField (cyclomatic 41) extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupConverter.java:348— ParquetGroupConverter.convertPrimitiveField has cyclomatic complexity 41 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
measure-menu.MeasureMenu (cyclomatic 41) web-console/src/views/explore-view/components/control-pane/measure-menu.tsx:56— measure-menu.MeasureMenu has cyclomatic complexity 41 (threshold 15). Of this number, 21 points are the body's own statements and 20 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
filter-menu.FilterMenu (cyclomatic 40) web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:120— filter-menu.FilterMenu has cyclomatic complexity 40 (threshold 15). Of this number, 24 points are the body's own statements and 16 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QueryManager.run (cyclomatic 39) web-console/src/utils/query-manager/query-manager.ts:125— QueryManager.run has cyclomatic complexity 39 (threshold 15). Of this number, 30 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SegmentsView.renderSegmentsTable (cyclomatic 39) web-console/src/views/segments-view/segments-view.tsx:600— SegmentsView.renderSegmentsTable has cyclomatic complexity 39 (threshold 15). Of this number, 17 points are the body's own statements and 22 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SqlScanner.scan (cyclomatic 38) jdbc-driver/src/main/java/org/apache/druid/jdbc/sql/SqlScanner.java:62— SqlScanner.scan has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
explore-view.ExploreView (cyclomatic 38) web-console/src/views/explore-view/explore-view.tsx:114— explore-view.ExploreView has cyclomatic complexity 38 (threshold 15). Of this number, 22 points are the body's own statements and 16 belong to 12 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PeriodGranularity.truncate (cyclomatic 37) processing/src/main/java/org/apache/druid/java/util/common/granularity/PeriodGranularity.java:406— PeriodGranularity.truncate has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NestedPathFinder.parseJqPath (cyclomatic 36) processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:284— NestedPathFinder.parseJqPath has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sql-completions.getSqlCompletions (cyclomatic 36) web-console/src/editor-completions/sql-completions.ts:236— sql-completions.getSqlCompletions has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JettyServerModule.makeAndInitializeServer (cyclomatic 35) server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java:181— JettyServerModule.makeAndInitializeServer has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkbenchQuery.getApiQuery (cyclomatic 35) web-console/src/druid-models/workbench-query/workbench-query.ts:503— WorkbenchQuery.getApiQuery has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
result-table-pane.ResultTablePane::getHeaderMenu (cyclomatic 35) web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:167— result-table-pane.ResultTablePane::getHeaderMenu has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExprEval.bestEffortOf (cyclomatic 34) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:403— ExprEval.bestEffortOf has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DruidRexExecutor.reduce (cyclomatic 34) sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java:68— DruidRexExecutor.reduce has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NestedPathFinder.parseJsonPathInternal (cyclomatic 33) processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:139— NestedPathFinder.parseJsonPathInternal has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExpressionPlanner.plan (cyclomatic 33) processing/src/main/java/org/apache/druid/segment/virtual/ExpressionPlanner.java:54— ExpressionPlanner.plan has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
segment-timeline.SegmentTimeline (cyclomatic 33) web-console/src/components/segment-timeline/segment-timeline.tsx:81— segment-timeline.SegmentTimeline has cyclomatic complexity 33 (threshold 15). Of this number, 22 points are the body's own statements and 11 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ImmutableConciseSet.doIntersection (cyclomatic 32) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:491— ImmutableConciseSet.doIntersection has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
module-pane.ModulePane (cyclomatic 32) web-console/src/views/explore-view/components/module-pane/module-pane.tsx:106— module-pane.ModulePane has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 15 of the 32 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 220, updateParameterValues, a function literal at line 331, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
DruidPreparedStatement.setObject (cyclomatic 31) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidPreparedStatement.java:571— DruidPreparedStatement.setObject has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AutoTypeColumnMerger.writeMergedValueDictionary (cyclomatic 31) processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:127— AutoTypeColumnMerger.writeMergedValueDictionary has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConciseSet.compareTo (cyclomatic 31) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1261— ConciseSet.compareTo has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DependencyReportParser.handle_starttag (cyclomatic 31) distribution/bin/check-licenses.py:61— DependencyReportParser.handle_starttag has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input-format-step.InputFormatStep (cyclomatic 31) web-console/src/views/workbench-view/input-format-step/input-format-step.tsx:92— input-format-step.InputFormatStep has cyclomatic complexity 31 (threshold 15). Of this number, 22 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rollup-analysis-pane.RollupAnalysisPane (cyclomatic 31) web-console/src/views/sql-data-loader-view/schema-step/rollup-analysis-pane/rollup-analysis-pane.tsx:144— rollup-analysis-pane.RollupAnalysisPane has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 154, a function literal at line 192, renderOverallResult, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
refresh-license-versions.refresh_versions (cyclomatic 30) distribution/bin/refresh-license-versions.py:76— refresh-license-versions.refresh_versions has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
execution-stages-pane.ExecutionStagesPane (cyclomatic 30) web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx:183— execution-stages-pane.ExecutionStagesPane has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (execution-stages-pane.ExecutionStagesPane::detailedCountersForWorkers) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
LoadDataView.renderConnectStep (cyclomatic 30) web-console/src/views/load-data-view/load-data-view.tsx:1290— LoadDataView.renderConnectStep has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InputSourceSampler.sample (cyclomatic 29) indexing-service/src/main/java/org/apache/druid/indexing/overlord/sampler/InputSourceSampler.java:97— InputSourceSampler.sample has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImmutableConciseSet.doUnion (cyclomatic 29) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:342— ImmutableConciseSet.doUnion has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SqlResults.coerce (cyclomatic 29) sql/src/main/java/org/apache/druid/sql/calcite/run/SqlResults.java:53— SqlResults.coerce has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
input-source-step.InputSourceStep (cyclomatic 29) web-console/src/views/workbench-view/input-source-step/input-source-step.tsx:79— input-source-step.InputSourceStep has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 93, a function literal at line 184, a function literal at line 129, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ExprEval.ofType (cyclomatic 28) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:522— ExprEval.ofType has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fancy-numeric-input.FancyNumericInput (cyclomatic 28) web-console/src/components/fancy-numeric-input/fancy-numeric-input.tsx:86— fancy-numeric-input.FancyNumericInput has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HttpRemoteTaskRunner.taskAddedOrUpdated (cyclomatic 27) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1445— HttpRemoteTaskRunner.taskAddedOrUpdated has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Projections.walkClusterGroupFilter (cyclomatic 27) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:863— Projections.walkClusterGroupFilter has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImmutableConciseSet.addAndCompact (cyclomatic 27) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:281— ImmutableConciseSet.addAndCompact has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LoadDataView.renderParserStep (cyclomatic 27) web-console/src/views/load-data-view/load-data-view.tsx:1535— LoadDataView.renderParserStep has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ControllerImpl.runInternal (cyclomatic 26) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:415— ControllerImpl.runInternal has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DruidLogicalValuesRule.getValueFromLiteral (cyclomatic 26) sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRule.java:95— DruidLogicalValuesRule.getValueFromLiteral has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DependencyReportParser.handle_endtag (cyclomatic 26) distribution/bin/check-licenses.py:118— DependencyReportParser.handle_endtag has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
supervisor-to-sql-dialog.SupervisorToSqlDialog (cyclomatic 26) web-console/src/dialogs/supervisor-to-sql-dialog/supervisor-to-sql-dialog.tsx:49— supervisor-to-sql-dialog.SupervisorToSqlDialog has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (loadSupervisorSpec, parsePastedSupervisor, handleConvert, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Stages.getByPartitionCountersForStage (cyclomatic 26) web-console/src/druid-models/stages/stages.ts:745— Stages.getByPartitionCountersForStage has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
NestedFieldColumnIndexSupplier.as (cyclomatic 25) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:149— NestedFieldColumnIndexSupplier.as has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ApproximateHistogram.ruleCombineBins (cyclomatic 25) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:671— ApproximateHistogram.ruleCombineBins has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
column-actions.ColumnActions (cyclomatic 25) web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:39— column-actions.ColumnActions has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
column-editor.ColumnEditor (cyclomatic 25) web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx:129— column-editor.ColumnEditor has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CostBasedAutoScaler.computeOptimalTaskCountInternal (cyclomatic 24) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:277— CostBasedAutoScaler.computeOptimalTaskCountInternal has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SeekableStreamSupervisor.createNewTasks (cyclomatic 24) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4516— SeekableStreamSupervisor.createNewTasks has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DruidQuery.computeVirtualColumns (cyclomatic 24) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:740— DruidQuery.computeVirtualColumns has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generate-binary-license.print_license (cyclomatic 24) distribution/bin/generate-binary-license.py:91— generate-binary-license.print_license has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SeekableStreamSupervisor.verifyAndMergeCheckpoints (cyclomatic 23) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2875— SeekableStreamSupervisor.verifyAndMergeCheckpoints has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TaskLockbox.createOrFindLockPosse (cyclomatic 23) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:564— TaskLockbox.createOrFindLockPosse has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TaskLockbox.revokeAllIncompatibleActiveLocksIfPossible (cyclomatic 23) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1582— TaskLockbox.revokeAllIncompatibleActiveLocksIfPossible has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QueryResultsIteratorImpl.readDataObject (cyclomatic 23) jdbc-driver/src/main/java/org/apache/druid/jdbc/http/QueryResultsIteratorImpl.java:274— QueryResultsIteratorImpl.readDataObject has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
InDimFilter.optimizeLookup (cyclomatic 23) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:455— InDimFilter.optimizeLookup has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
1.run (cyclomatic 23) processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryRunnerFactory.java:75— 1.run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (2793.run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ColumnType.leastRestrictiveType (cyclomatic 23) processing/src/main/java/org/apache/druid/segment/column/ColumnType.java:162— ColumnType.leastRestrictiveType has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExprEval.coerceListToArray (cyclomatic 23) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:153— ExprEval.coerceListToArray has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
2793.run (cyclomatic 23) processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryRunnerFactory.java:75— 2793.run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (1.run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ConsulLeaderSelector.leaderElectionLoop (cyclomatic 23) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulLeaderSelector.java:228— ConsulLeaderSelector.leaderElectionLoop has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rule-editor.RuleEditor (cyclomatic 23) web-console/src/components/rule-editor/rule-editor.tsx:52— rule-editor.RuleEditor has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (addTier, renderTiers, a function literal at line 107, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
execution-stages-pane.ExecutionStagesPane::detailedCountersForWorkers (cyclomatic 23) web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx:223— execution-stages-pane.ExecutionStagesPane::detailedCountersForWorkers has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (execution-stages-pane.ExecutionStagesPane) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
input-source.issueWithInputSource (cyclomatic 23) web-console/src/druid-models/input-source/input-source.tsx:142— input-source.issueWithInputSource has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
schema-table.SchemaTable (cyclomatic 23) web-console/src/views/load-data-view/schema-table/schema-table.tsx:61— schema-table.SchemaTable has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 82, 139, 107, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
services-view.DetailCell (cyclomatic 23) web-console/src/views/services-view/services-view.tsx:254— services-view.DetailCell has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
execution-details-pane.ExecutionDetailsPane::renderContent (cyclomatic 23) web-console/src/views/workbench-view/execution-details-pane/execution-details-pane.tsx:59— execution-details-pane.ExecutionDetailsPane::renderContent has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LagBasedAutoScalerConfig.<init> (cyclomatic 22) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/LagBasedAutoScalerConfig.java:62— LagBasedAutoScalerConfig.<init> has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RangeFilter.makeComparatorPredicate (cyclomatic 22) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:962— RangeFilter.makeComparatorPredicate has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (RangeFilter.makeTypeDetectingArrayPredicate) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RangeFilter.makeTypeDetectingArrayPredicate (cyclomatic 22) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:659— RangeFilter.makeTypeDetectingArrayPredicate has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (RangeFilter.makeComparatorPredicate) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HavingSpecMetricComparator.compare (cyclomatic 22) processing/src/main/java/org/apache/druid/query/groupby/having/HavingSpecMetricComparator.java:40— HavingSpecMetricComparator.compare has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexMergerBase.makeProjections (cyclomatic 22) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:478— IndexMergerBase.makeProjections has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ConciseSet.add (cyclomatic 22) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:904— ConciseSet.add has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConnectionUriUtils.tryParseJdbcUriParameters (cyclomatic 22) processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:100— ConnectionUriUtils.tryParseJdbcUriParameters has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
AsyncQueryForwardingServlet.getAvaticaProtobufConnectionId (cyclomatic 22) services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java:715— AsyncQueryForwardingServlet.getAvaticaProtobufConnectionId has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DruidAggregateCaseToFilterRule.transform (cyclomatic 22) sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidAggregateCaseToFilterRule.java:137— DruidAggregateCaseToFilterRule.transform has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
KafkaEmitterConfig.equals (cyclomatic 22) extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitterConfig.java:275— KafkaEmitterConfig.equals has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
external-config.summarizeInputSource (cyclomatic 22) web-console/src/druid-models/external-config/external-config.ts:55— external-config.summarizeInputSource has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ingest-query-pattern.fitIngestQueryPattern (cyclomatic 22) web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts:140— ingest-query-pattern.fitIngestQueryPattern has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TasksView.renderTaskTable (cyclomatic 22) web-console/src/views/tasks-view/tasks-view.tsx:374— TasksView.renderTaskTable has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 448, 472, 495, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
execution-submit-dialog.ExecutionSubmitDialog (cyclomatic 22) web-console/src/views/workbench-view/execution-submit-dialog/execution-submit-dialog.tsx:52— execution-submit-dialog.ExecutionSubmitDialog has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to one function item inside it that branches (handleSubmit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SeekableStreamIndexTaskTuningConfig.<init> (cyclomatic 21) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTuningConfig.java:131— SeekableStreamIndexTaskTuningConfig.<init> has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HttpRemoteTaskRunner.pendingTasksExecutionLoop (cyclomatic 21) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1091— HttpRemoteTaskRunner.pendingTasksExecutionLoop has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkerImpl.runInternal (cyclomatic 21) multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerImpl.java:258— WorkerImpl.runInternal has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClusteredValueGroupsBaseTableSchema.<init> (cyclomatic 21) processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:74— ClusteredValueGroupsBaseTableSchema.<init> has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsonConfigurator.configurate (cyclomatic 21) processing/src/main/java/org/apache/druid/guice/JsonConfigurator.java:94— JsonConfigurator.configurate has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConciseSet.performOperation (cyclomatic 21) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:626— ConciseSet.performOperation has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConciseSet.remove (cyclomatic 21) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:999— ConciseSet.remove has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GranularityType.fromPeriod (cyclomatic 21) processing/src/main/java/org/apache/druid/java/util/common/granularity/GranularityType.java:192— GranularityType.fromPeriod has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HumanReadableBytes.parseInner (cyclomatic 21) processing/src/main/java/org/apache/druid/java/util/common/HumanReadableBytes.java:143— HumanReadableBytes.parseInner has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DruidNode.init (cyclomatic 21) server/src/main/java/org/apache/druid/server/DruidNode.java:192— DruidNode.init has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MoveTimeFiltersToIntervals.extractConvertibleTimeBounds (cyclomatic 21) sql/src/main/java/org/apache/druid/sql/calcite/filtration/MoveTimeFiltersToIntervals.java:92— MoveTimeFiltersToIntervals.extractConvertibleTimeBounds has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DruidQuery.toTimeseriesQuery (cyclomatic 21) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1146— DruidQuery.toTimeseriesQuery has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cell-filter-menu.CellFilterMenu (cyclomatic 21) web-console/src/components/cell-filter-menu/cell-filter-menu.tsx:88— cell-filter-menu.CellFilterMenu has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
values-query.queryResultToValuesQuery (cyclomatic 21) web-console/src/utils/values-query.tsx:61— values-query.queryResultToValuesQuery has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 68, 100). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
filter-pane.FilterPane (cyclomatic 21) web-console/src/views/explore-view/components/filter-pane/filter-pane.tsx:63— filter-pane.FilterPane has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 7 function items inside it that branch (filterTooltip, a function literal at line 89, a function literal at line 136, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WorkbenchView.renderCenterPanel (cyclomatic 21) web-console/src/views/workbench-view/workbench-view.tsx:785— WorkbenchView.renderCenterPanel has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SeekableStreamSupervisor.checkTaskDuration (cyclomatic 20) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:3938— SeekableStreamSupervisor.checkTaskDuration has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SeekableStreamSupervisor.updatePartitionDataFromStream (cyclomatic 20) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:3395— SeekableStreamSupervisor.updatePartitionDataFromStream has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompactionTask.createDataSchema (cyclomatic 20) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:835— CompactionTask.createDataSchema has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexTuningConfig.<init> (cyclomatic 20) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1338— IndexTuningConfig.<init> has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ControllerQueryKernelUtils.computeStageGroups (cyclomatic 20) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernelUtils.java:96— ControllerQueryKernelUtils.computeStageGroups has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypedInFilter.createStringPredicate (cyclomatic 20) processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:533— TypedInFilter.createStringPredicate has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Metadata.merge (cyclomatic 20) processing/src/main/java/org/apache/druid/segment/Metadata.java:207— Metadata.merge has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PeriodGranularity.canBeMappedTo (cyclomatic 20) processing/src/main/java/org/apache/druid/java/util/common/granularity/PeriodGranularity.java:250— PeriodGranularity.canBeMappedTo has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NettyHttpClient.go (cyclomatic 20) processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java:107— NettyHttpClient.go has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReaderUtils.getColumnsRequiredForIngestion (cyclomatic 20) server/src/main/java/org/apache/druid/segment/indexing/ReaderUtils.java:48— ReaderUtils.getColumnsRequiredForIngestion has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArrayOverlapOperatorConversion.toDruidFilter (cyclomatic 20) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayOverlapOperatorConversion.java:86— ArrayOverlapOperatorConversion.toDruidFilter has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DruidQuery.toGroupByQuery (cyclomatic 20) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1373— DruidQuery.toGroupByQuery has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
1.doFilterSuper (cyclomatic 20) extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/KerberosAuthenticator.java:246— 1.doFilterSuper has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KafkaLookupExtractorFactory.start (cyclomatic 20) extensions-core/kafka-extraction-namespace/src/main/java/org/apache/druid/query/lookup/KafkaLookupExtractorFactory.java:155— KafkaLookupExtractorFactory.start has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConsoleApplication.renderView (cyclomatic 20) web-console/src/console-application.tsx:444— ConsoleApplication.renderView has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DruidPreparedStatement.setObject (cyclomatic 19) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidPreparedStatement.java:346— DruidPreparedStatement.setObject has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ControllerStageTracker.mergeClusterByStatisticsCollectorForTimeChunk (cyclomatic 19) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:536— ControllerStageTracker.mergeClusterByStatisticsCollectorForTimeChunk has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FirstLastVectorAggregator.aggregate (cyclomatic 19) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java:72— FirstLastVectorAggregator.aggregate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AlphanumericComparator.compareNumbers (cyclomatic 19) processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:154— AlphanumericComparator.compareNumbers has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LazilyDecoratedRowsAndColumns.naiveMaterialize (cyclomatic 19) processing/src/main/java/org/apache/druid/query/rowsandcols/LazilyDecoratedRowsAndColumns.java:295— LazilyDecoratedRowsAndColumns.naiveMaterialize has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ColumnValueGenerator.initDistribution (cyclomatic 19) processing/src/main/java/org/apache/druid/segment/generator/ColumnValueGenerator.java:142— ColumnValueGenerator.initDistribution has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ExpressionSelectors.createBindings (cyclomatic 19) processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java:281— ExpressionSelectors.createBindings has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NestedFieldVirtualColumn.getIndexSupplier (cyclomatic 19) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:680— NestedFieldVirtualColumn.getIndexSupplier has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReadableByteChunksFrameChannel.updateStreamState (cyclomatic 19) processing/src/main/java/org/apache/druid/frame/channel/ReadableByteChunksFrameChannel.java:396— ReadableByteChunksFrameChannel.updateStreamState has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SuperSorter.runNextMiddleMerger (cyclomatic 19) processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java:570— SuperSorter.runNextMiddleMerger has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StringFrameColumnWriter.addSelection (cyclomatic 19) processing/src/main/java/org/apache/druid/frame/write/columnar/StringFrameColumnWriter.java:99— StringFrameColumnWriter.addSelection has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExpressionTypeConversion.leastRestrictiveType (cyclomatic 19) processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:162— ExpressionTypeConversion.leastRestrictiveType has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ServerManager.getOrLoadSegmentReferences (cyclomatic 19) server/src/main/java/org/apache/druid/server/ServerManager.java:291— ServerManager.getOrLoadSegmentReferences has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexerSQLMetadataStorageCoordinator.createNewSegmentsAfterReplace (cyclomatic 19) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1896— IndexerSQLMetadataStorageCoordinator.createNewSegmentsAfterReplace has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PartialSegmentMetadataCacheEntry.applyRule (cyclomatic 19) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:313— PartialSegmentMetadataCacheEntry.applyRule has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArrayContainsOperatorConversion.toDruidFilter (cyclomatic 19) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:86— ArrayContainsOperatorConversion.toDruidFilter has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SearchOperatorConversion.expandSearch (cyclomatic 19) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/SearchOperatorConversion.java:114— SearchOperatorConversion.expandSearch has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DefaultOperandTypeChecker.checkOperandTypes (cyclomatic 19) sql/src/main/java/org/apache/druid/sql/calcite/expression/DefaultOperandTypeChecker.java:98— DefaultOperandTypeChecker.checkOperandTypes has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Expressions.calciteLiteralToDruidLiteral (cyclomatic 19) sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:327— Expressions.calciteLiteralToDruidLiteral has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AmbariMetricsEmitterConfig.equals (cyclomatic 19) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitterConfig.java:191— AmbariMetricsEmitterConfig.equals has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NodeRoleWatcher.watch (cyclomatic 19) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:220— NodeRoleWatcher.watch has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
InfluxdbEmitterConfig.equals (cyclomatic 19) extensions-contrib/influxdb-emitter/src/main/java/org/apache/druid/emitter/influxdb/InfluxdbEmitterConfig.java:103— InfluxdbEmitterConfig.equals has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FixedBucketsHistogramQuantileSqlAggregator.toDruidAggregation (cyclomatic 19) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:66— FixedBucketsHistogramQuantileSqlAggregator.toDruidAggregation has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sql-task-execution.getTaskExecution (cyclomatic 19) web-console/src/helpers/execution/sql-task-execution.ts:161— sql-task-execution.getTaskExecution has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
expression-menu.ExpressionMenu (cyclomatic 19) web-console/src/views/explore-view/components/control-pane/expression-menu.tsx:59— expression-menu.ExpressionMenu has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
control-pane.ControlPane::renderOptionsPropInput (cyclomatic 19) web-console/src/views/explore-view/components/control-pane/control-pane.tsx:81— control-pane.ControlPane::renderOptionsPropInput has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
helper-table.HelperTable (cyclomatic 19) web-console/src/views/explore-view/components/helper-table/helper-table.tsx:62— helper-table.HelperTable has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
services-card.ServicesCard (cyclomatic 19) web-console/src/views/home-view/services-card/services-card.tsx:44— services-card.ServicesCard has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 46). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
DynamicAllocationTasksNotice.handle (cyclomatic 18) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:588— DynamicAllocationTasksNotice.handle has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SeekableStreamSupervisorIOConfig.<init> (cyclomatic 18) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisorIOConfig.java:72— SeekableStreamSupervisorIOConfig.<init> has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MSQErrorReport.getFaultFromException (cyclomatic 18) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/MSQErrorReport.java:219— MSQErrorReport.getFaultFromException has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ControllerQueryKernel.registerStagePhaseChange (cyclomatic 18) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernel.java:755— ControllerQueryKernel.registerStagePhaseChange has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkerInputs.create (cyclomatic 18) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/WorkerInputs.java:61— WorkerInputs.create has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelStageOutputReader.readRemotelyFrom (cyclomatic 18) multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/ChannelStageOutputReader.java:121— ChannelStageOutputReader.readRemotelyFrom has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JoinLogic.joinRows (cyclomatic 18) processing/src/main/java/org/apache/druid/query/operator/join/SortedInnerJoinOperator.java:321— JoinLogic.joinRows has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BoundFilter.getBitmapColumnIndex (cyclomatic 18) processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java:75— BoundFilter.getBitmapColumnIndex has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompressedNestedDataComplexColumn.readNestedFieldColumn (cyclomatic 18) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:1082— CompressedNestedDataComplexColumn.readNestedFieldColumn has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Projections.buildClusterVirtualColumnRemap (cyclomatic 18) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:758— Projections.buildClusterVirtualColumnRemap has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NestedFieldVirtualColumn.makeColumnValueSelector (cyclomatic 18) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:373— NestedFieldVirtualColumn.makeColumnValueSelector has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexMergerBase.mergeIndexesAndWriteColumns (cyclomatic 18) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:763— IndexMergerBase.mergeIndexesAndWriteColumns has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
IndexMergerV10.makeClusteredIndexFiles (cyclomatic 18) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:359— IndexMergerV10.makeClusteredIndexFiles has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexMergerV10.makeIndexFiles (cyclomatic 18) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:98— IndexMergerV10.makeIndexFiles has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrameChannelMerger.writeNextFrameWithCombiner (cyclomatic 18) processing/src/main/java/org/apache/druid/frame/processor/FrameChannelMerger.java:302— FrameChannelMerger.writeNextFrameWithCombiner has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
1.channelRead0 (cyclomatic 18) processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java:246— 1.channelRead0 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QueryResultPusher.push (cyclomatic 18) server/src/main/java/org/apache/druid/server/QueryResultPusher.java:125— QueryResultPusher.push has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PartialSegmentBundleCacheEntry.doMount (cyclomatic 18) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:392— PartialSegmentBundleCacheEntry.doMount has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SegmentLocalCacheManager.realizeRuleOrRestorePrior (cyclomatic 18) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1139— SegmentLocalCacheManager.realizeRuleOrRestorePrior has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BaseAppenderatorDriver.publishInBackground (cyclomatic 18) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java:585— BaseAppenderatorDriver.publishInBackground has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AsyncQueryForwardingServlet.service (cyclomatic 18) services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java:214— AsyncQueryForwardingServlet.service has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FilterJoinExcludePushToChildRule.perform (cyclomatic 18) sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRule.java:96— FilterJoinExcludePushToChildRule.perform has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DeltaInputRow.getValue (cyclomatic 18) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/DeltaInputRow.java:172— DeltaInputRow.getValue has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatsDEmitter.emitMetric (cyclomatic 18) extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/StatsDEmitter.java:115— StatsDEmitter.emitMetric has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EC2NodeData.equals (cyclomatic 18) extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2NodeData.java:135— EC2NodeData.equals has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HdfsDataSegmentKiller.kill (cyclomatic 18) extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java:81— HdfsDataSegmentKiller.kill has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServerSideEncryptingAmazonS3.builder (cyclomatic 18) extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java:318— ServerSideEncryptingAmazonS3.builder has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
json-input.JsonInput (cyclomatic 18) web-console/src/components/json-input/json-input.tsx:101— json-input.JsonInput has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (handleInputChange, a function literal at line 168, a function literal at line 193, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
header-bar.HeaderBar (cyclomatic 18) web-console/src/components/header-bar/header-bar.tsx:72— header-bar.HeaderBar has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
record-table-pane.RecordTablePane (cyclomatic 18) web-console/src/components/record-table-pane/record-table-pane.tsx:53— record-table-pane.RecordTablePane has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 138, hasFilterOnHeader, getHeaderClassName, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
segment-bar-chart.SegmentBarChart (cyclomatic 18) web-console/src/components/segment-timeline/segment-bar-chart.tsx:43— segment-bar-chart.SegmentBarChart has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 94, 129, 53). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
date.parseIsoDate (cyclomatic 18) web-console/src/utils/date.ts:134— date.parseIsoDate has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
time-manipulation.shiftBackAndExpandTimeInExpression (cyclomatic 18) web-console/src/views/explore-view/utils/time-manipulation.ts:112— time-manipulation.shiftBackAndExpandTimeInExpression has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 117). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
time-chart-module.getRangeInExpression (cyclomatic 18) web-console/src/views/explore-view/modules/time-chart-module/time-chart-module.tsx:60— time-chart-module.getRangeInExpression has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
execution-progress-bar-pane.ExecutionProgressBarPane (cyclomatic 18) web-console/src/views/workbench-view/execution-progress-bar-pane/execution-progress-bar-pane.tsx:34— execution-progress-bar-pane.ExecutionProgressBarPane has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sql-data-loader-view.SqlDataLoaderView (cyclomatic 18) web-console/src/views/sql-data-loader-view/sql-data-loader-view.tsx:68— sql-data-loader-view.SqlDataLoaderView has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 148, submitTask). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
explain-dialog.ExplainDialog (cyclomatic 18) web-console/src/views/workbench-view/explain-dialog/explain-dialog.tsx:65— explain-dialog.ExplainDialog has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 70, renderQueryExplanation). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SeekableStreamIndexTaskRunner.setEndOffsets (cyclomatic 17) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:2012— SeekableStreamIndexTaskRunner.setEndOffsets has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
6675.call (cyclomatic 17) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:164— 6675.call has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CompactionTask.createInputDataSchemas (cyclomatic 17) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:637— CompactionTask.createInputDataSchemas has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SegmentGenerationUtils.makeDimensionsAndAggregatorsForIngestion (cyclomatic 17) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/SegmentGenerationUtils.java:299— SegmentGenerationUtils.makeDimensionsAndAggregatorsForIngestion has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ControllerStageTracker.addPartialKeyInformationForWorker (cyclomatic 17) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:417— ControllerStageTracker.addPartialKeyInformationForWorker has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Rows.objectToNumber (cyclomatic 17) processing/src/main/java/org/apache/druid/data/input/Rows.java:114— Rows.objectToNumber has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FrontCodedIndexed.indexOf (cyclomatic 17) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:228— FrontCodedIndexed.indexOf has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontCodedIntArrayIndexed.indexOf (cyclomatic 17) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:170— FrontCodedIntArrayIndexed.indexOf has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IncrementalIndex.toIncrementalIndexRow (cyclomatic 17) processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java:490— IncrementalIndex.toIncrementalIndexRow has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VariantColumnSerializer.serialize (cyclomatic 17) processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:238— VariantColumnSerializer.serialize has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProjectionFilterMatch.rewriteFilter (cyclomatic 17) processing/src/main/java/org/apache/druid/segment/projections/ProjectionFilterMatch.java:51— ProjectionFilterMatch.rewriteFilter has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Projections.matchQueryVirtualColumn (cyclomatic 17) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:511— Projections.matchQueryVirtualColumn has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NestedFieldVirtualColumn.makeVectorValueSelector (cyclomatic 17) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:598— NestedFieldVirtualColumn.makeVectorValueSelector has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexMergerV9.makeIndexFiles (cyclomatic 17) processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java:117— IndexMergerV9.makeIndexFiles has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConciseSet.contains (cyclomatic 17) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1095— ConciseSet.contains has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
1ExecutorRunnable.run (cyclomatic 17) processing/src/main/java/org/apache/druid/frame/processor/FrameProcessorExecutor.java:130— 1ExecutorRunnable.run has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StrategicSegmentAssigner.updateReplicasInTierPartial (cyclomatic 17) server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:389— StrategicSegmentAssigner.updateReplicasInTierPartial has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SegmentLocalCacheManager.acquireCachedInternal (cyclomatic 17) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:556— SegmentLocalCacheManager.acquireCachedInternal has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompleteSegmentCacheEntry.mount (cyclomatic 17) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:2299— CompleteSegmentCacheEntry.mount has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BatchAppenderator.mergeAndPush (cyclomatic 17) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:754— BatchAppenderator.mergeAndPush has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StreamAppenderator.add (cyclomatic 17) server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:305— StreamAppenderator.add has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CastOperatorConversion.toDruidExpression (cyclomatic 17) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/CastOperatorConversion.java:57— CastOperatorConversion.toDruidExpression has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DruidSqlParserUtils.convertSqlNodeToGranularity (cyclomatic 17) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParserUtils.java:113— DruidSqlParserUtils.convertSqlNodeToGranularity has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CatalogColumnTypes.convert (cyclomatic 17) sql/src/main/java/org/apache/druid/sql/calcite/planner/CatalogColumnTypes.java:83— CatalogColumnTypes.convert has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RowSerde.convertRowToJsonObject (cyclomatic 17) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/RowSerde.java:102— RowSerde.convertRowToJsonObject has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
KafkaEmitter.emit (cyclomatic 17) extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitter.java:253— KafkaEmitter.emit has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClipOutlierHandler.simpleInterpolateMergeHandleOutliers (cyclomatic 17) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:1299— ClipOutlierHandler.simpleInterpolateMergeHandleOutliers has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
1.hasNext (cyclomatic 17) extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/DefaultK8sApiClient.java:198— 1.hasNext has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
3602.apply (cyclomatic 17) extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3Utils.java:87— 3602.apply has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
retention-dialog.RetentionDialog (cyclomatic 17) web-console/src/dialogs/retention-dialog/retention-dialog.tsx:49— retention-dialog.RetentionDialog has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
query-error-pane.QueryErrorPane (cyclomatic 17) web-console/src/components/query-error-pane/query-error-pane.tsx:34— query-error-pane.QueryErrorPane has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
parse-time-table.ParseTimeTable (cyclomatic 17) web-console/src/views/load-data-view/parse-time-table/parse-time-table.tsx:70— parse-time-table.ParseTimeTable has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 90, 132, 97, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LoadDataView.renderSpecStep (cyclomatic 17) web-console/src/views/load-data-view/load-data-view.tsx:3625— LoadDataView.renderSpecStep has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: LoadDataView.isStepEnabled (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
schema-step.getTimeSuggestions (cyclomatic 17) web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:142— schema-step.getTimeSuggestions has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
recent-query-task-panel.RecentQueryTaskPanel (cyclomatic 17) web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.tsx:84— recent-query-task-panel.RecentQueryTaskPanel has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 134, 148, 278). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
link-lint.entries.forEach() (cyclomatic 17) website/script/link-lint.js:31— link-lint.entries.forEach() has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 36). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
SeekableStreamSupervisor.resetInternal (cyclomatic 16) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2218— SeekableStreamSupervisor.resetInternal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
102665.apply (cyclomatic 16) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2562— 102665.apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
174342.apply (cyclomatic 16) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4154— 174342.apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TaskLockbox.unlock (cyclomatic 16) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1115— TaskLockbox.unlock has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ParallelIndexPhaseRunner.run (cyclomatic 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexPhaseRunner.java:114— ParallelIndexPhaseRunner.run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ParallelIndexTuningConfig.<init> (cyclomatic 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexTuningConfig.java:116— ParallelIndexTuningConfig.<init> has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CompactionTask.<init> (cyclomatic 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:192— CompactionTask.<init> has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IndexTask.generateAndPublishSegments (cyclomatic 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:810— IndexTask.generateAndPublishSegments has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DruidResultSet.getObject (cyclomatic 16) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidResultSet.java:1416— DruidResultSet.getObject has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GroupByPreShuffleStageProcessor.filterBaseInput (cyclomatic 16) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPreShuffleStageProcessor.java:117— GroupByPreShuffleStageProcessor.filterBaseInput has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MSQTaskSqlEngine.validateTypeChanges (cyclomatic 16) multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java:386— MSQTaskSqlEngine.validateTypeChanges has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MSQTaskSqlEngine.featureAvailable (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RowBasedGrouperHelper.createGrouperAccumulatorPair (cyclomatic 16) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:190— RowBasedGrouperHelper.createGrouperAccumulatorPair has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SegmentAnalyzer.analyze (cyclomatic 16) processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java:90— SegmentAnalyzer.analyze has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LazilyDecoratedRowsAndColumns.materializeCursorFactory (cyclomatic 16) processing/src/main/java/org/apache/druid/query/rowsandcols/LazilyDecoratedRowsAndColumns.java:205— LazilyDecoratedRowsAndColumns.materializeCursorFactory has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SearchBinaryFn.apply (cyclomatic 16) processing/src/main/java/org/apache/druid/query/search/SearchBinaryFn.java:53— SearchBinaryFn.apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BoundFilter.doesMatch (cyclomatic 16) processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java:268— BoundFilter.doesMatch has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
1.matches (cyclomatic 16) processing/src/main/java/org/apache/druid/segment/filter/ExpressionFilter.java:144— 1.matches has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexedTableJoinMatcher.matchCondition (cyclomatic 16) processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java:177— IndexedTableJoinMatcher.matchCondition has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HashJoinSegmentCursorFactory.planJoinCursor (cyclomatic 16) processing/src/main/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactory.java:160— HashJoinSegmentCursorFactory.planJoinCursor has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NestedFieldVirtualColumn.makeVectorObjectSelector (cyclomatic 16) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:510— NestedFieldVirtualColumn.makeVectorObjectSelector has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Batch.tryReleaseShared (cyclomatic 16) processing/src/main/java/org/apache/druid/java/util/emitter/core/Batch.java:266— Batch.tryReleaseShared has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArrayExprEval.castTo (cyclomatic 16) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1295— ArrayExprEval.castTo has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReservoirSegmentSampler.getRandomBalancerSegmentHolder (cyclomatic 16) server/src/main/java/org/apache/druid/server/coordinator/balancer/ReservoirSegmentSampler.java:111— ReservoirSegmentSampler.getRandomBalancerSegmentHolder has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompactSegments.createCompactionTask (cyclomatic 16) server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java:302— CompactSegments.createCompactionTask has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClientCompactionRunnerInfo.validatePartitionsSpecForMSQ (cyclomatic 16) server/src/main/java/org/apache/druid/client/indexing/ClientCompactionRunnerInfo.java:177— ClientCompactionRunnerInfo.validatePartitionsSpecForMSQ has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndexerSQLMetadataStorageCoordinator.createNewPendingSegment (cyclomatic 16) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1529— IndexerSQLMetadataStorageCoordinator.createNewPendingSegment has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PartialSegmentMetadataCacheEntry.doMount (cyclomatic 16) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:753— PartialSegmentMetadataCacheEntry.doMount has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CollectComparisons.collect (cyclomatic 16) sql/src/main/java/org/apache/druid/sql/calcite/filtration/CollectComparisons.java:61— CollectComparisons.collect has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DruidSqlParser.getUnexpectedTokenString (cyclomatic 16) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParser.java:348— DruidSqlParser.getUnexpectedTokenString has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
AggregateMergeRule.apply (cyclomatic 16) sql/src/main/java/org/apache/druid/sql/calcite/rule/AggregateMergeRule.java:71— AggregateMergeRule.apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KafkaEmitterConfig.<init> (cyclomatic 16) extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitterConfig.java:97— KafkaEmitterConfig.<init> has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatsDEmitterConfig.equals (cyclomatic 16) extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/StatsDEmitterConfig.java:106— StatsDEmitterConfig.equals has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HllSketchBaseSqlAggregator.toDruidAggregation (cyclomatic 16) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:68— HllSketchBaseSqlAggregator.toDruidAggregation has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ApproximateHistogram.sum (cyclomatic 16) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1460— ApproximateHistogram.sum has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PartitionResource.fetchRecords (cyclomatic 16) extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:206— PartitionResource.fetchRecords has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
S3InputSourceDefn.convertArgsToSourceMap (cyclomatic 16) extensions-core/s3-extensions/src/main/java/org/apache/druid/catalog/model/table/S3InputSourceDefn.java:194— S3InputSourceDefn.convertArgsToSourceMap has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
table-query.makeJoinCompareTableQueryAndHints (cyclomatic 16) web-console/src/views/explore-view/utils/table-query.ts:557— table-query.makeJoinCompareTableQueryAndHints has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QuerySource.restrictParameterValue (cyclomatic 16) web-console/src/views/explore-view/models/query-source.ts:344— QuerySource.restrictParameterValue has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tasks-card.TasksCard (cyclomatic 16) web-console/src/views/home-view/tasks-card/tasks-card.tsx:78— tasks-card.TasksCard has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
preview-table.PreviewTable (cyclomatic 16) web-console/src/views/sql-data-loader-view/schema-step/preview-table/preview-table.tsx:75— preview-table.PreviewTable has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 114, hasFilterOnHeader). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
execution-summary-panel.ExecutionSummaryPanel (cyclomatic 16) web-console/src/views/workbench-view/execution-summary-panel/execution-summary-panel.tsx:48— execution-summary-panel.ExecutionSummaryPanel has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SeekableStreamIndexTaskRunner.runInternal (cognitive 138) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:426— SeekableStreamIndexTaskRunner.runInternal has cognitive complexity 138 (threshold 15). Drivers by points: if/else 48 (99 pts), error handling 9 (13 pts), boolean chains 11, loops 6 (11 pts), ternaries 2 (4 pts) (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidRexExecutor.reduce (cognitive 122) sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java:68— DruidRexExecutor.reduce has cognitive complexity 122 (threshold 15). Drivers by points: if/else 40 (97 pts), loops 4 (18 pts), error handling 1 (5 pts), boolean chains 2 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Expressions.toSimpleLeafFilter (cognitive 104) sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:516— Expressions.toSimpleLeafFilter has cognitive complexity 104 (threshold 15). Drivers by points: if/else 43 (80 pts), boolean chains 11, match/switch 3 (9 pts), ternaries 2 (4 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
segment-bar-chart-render.SegmentBarChartRender (cognitive 102) web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:201— segment-bar-chart-render.SegmentBarChartRender has cognitive complexity 102 (threshold 15). Drivers by points: if/else 39 (57 pts), boolean chains 30, ternaries 6 (14 pts), match/switch 1 (nesting depth added 26). Of this number, 22 points are the body's own statements and 80 belong to 18 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CombineAndSimplifyBounds.doSimplify (cognitive 101) sql/src/main/java/org/apache/druid/sql/calcite/filtration/CombineAndSimplifyBounds.java:123— CombineAndSimplifyBounds.doSimplify has cognitive complexity 101 (threshold 15). Drivers by points: if/else 31 (57 pts), loops 15 (33 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentMetadataQueryQueryToolChest.mergeAnalyses (cognitive 100) processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java:267— SegmentMetadataQueryQueryToolChest.mergeAnalyses has cognitive complexity 100 (threshold 15). Drivers by points: if/else 29 (51 pts), loops 11 (26 pts), boolean chains 8, ternaries 5 (8 pts), error handling 1 (7 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
query-tab.QueryTab (cognitive 89) web-console/src/views/workbench-view/query-tab/query-tab.tsx:108— query-tab.QueryTab has cognitive complexity 89 (threshold 15). Drivers by points: if/else 32 (53 pts), boolean chains 17, error handling 3 (8 pts), ternaries 3 (7 pts), match/switch 2 (4 pts) (nesting depth added 32). Most of this is not in the body itself: 12 of the 89 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 210, a function literal at line 426, a function literal at line 157, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
continuous-chart-render.ContinuousChartRender (cognitive 88) web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx:150— continuous-chart-render.ContinuousChartRender has cognitive complexity 88 (threshold 15). Drivers by points: if/else 41 (55 pts), boolean chains 24, ternaries 7 (9 pts) (nesting depth added 16). Of this number, 27 points are the body's own statements and 61 belong to 16 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSet.compareTo (cognitive 86) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1261— ConciseSet.compareTo has cognitive complexity 86 (threshold 15). Drivers by points: if/else 30 (80 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
result-table-pane.ResultTablePane::getHeaderMenu (cognitive 86) web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:167— result-table-pane.ResultTablePane::getHeaderMenu has cognitive complexity 86 (threshold 15). Drivers by points: if/else 26 (66 pts), ternaries 4 (12 pts), boolean chains 8 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
check-licenses.check_licenses (cognitive 85) distribution/bin/check-licenses.py:475— check-licenses.check_licenses has cognitive complexity 85 (threshold 15). Drivers by points: if/else 23 (52 pts), loops 13 (25 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JettyServerModule.makeAndInitializeServer (cognitive 83) server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java:181— JettyServerModule.makeAndInitializeServer has cognitive complexity 83 (threshold 15). Drivers by points: if/else 25 (52 pts), ternaries 7 (25 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ImmutableConciseSet.doIntersection (cognitive 82) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:491— ImmutableConciseSet.doIntersection has cognitive complexity 82 (threshold 15). Drivers by points: if/else 31 (67 pts), loops 5 (11 pts), boolean chains 4 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PeriodGranularity.truncate (cognitive 77) processing/src/main/java/org/apache/druid/java/util/common/granularity/PeriodGranularity.java:406— PeriodGranularity.truncate has cognitive complexity 77 (threshold 15). Drivers by points: if/else 42 (66 pts), boolean chains 9, error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schema-step.SchemaStep (cognitive 76) web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:265— schema-step.SchemaStep has cognitive complexity 76 (threshold 15). Drivers by points: boolean chains 37, if/else 22 (24 pts), ternaries 11 (13 pts), error handling 1 (2 pts) (nesting depth added 5). Of this number, 44 points are the body's own statements and 32 belong to 17 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ImmutableConciseSet.doUnion (cognitive 71) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:342— ImmutableConciseSet.doUnion has cognitive complexity 71 (threshold 15). Drivers by points: if/else 22 (56 pts), loops 5 (11 pts), boolean chains 4 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NestedPathFinder.parseJqPath (cognitive 65) processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:284— NestedPathFinder.parseJqPath has cognitive complexity 65 (threshold 15). Drivers by points: if/else 24 (50 pts), boolean chains 11, error handling 1 (3 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasourcesView.renderDatasourcesTable (cognitive 64) web-console/src/views/datasources-view/datasources-view.tsx:1177— DatasourcesView.renderDatasourcesTable has cognitive complexity 64 (threshold 15). Drivers by points: if/else 30, boolean chains 20, ternaries 9 (14 pts) (nesting depth added 5). Most of this is not in the body itself: 14 of the 64 points are its own statements and the rest belongs to 20 function literals inside it that branch (lines 1262, 1461, 1672, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
column-actions.ColumnActions (cognitive 62) web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:39— column-actions.ColumnActions has cognitive complexity 62 (threshold 15). Drivers by points: if/else 13 (39 pts), ternaries 4 (16 pts), boolean chains 7 (nesting depth added 38). Of this number, 47 points are the body's own statements and 15 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NestedPathFinder.parseJsonPathInternal (cognitive 60) processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:139— NestedPathFinder.parseJsonPathInternal has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (48 pts), boolean chains 8, error handling 1 (3 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JoinLogic.joinRows (cognitive 59) processing/src/main/java/org/apache/druid/query/operator/join/SortedInnerJoinOperator.java:321— JoinLogic.joinRows has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 5 (21 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IndexedTableJoinMatcher.matchCondition (cognitive 58) processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java:177— IndexedTableJoinMatcher.matchCondition has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (42 pts), loops 4 (14 pts), boolean chains 2 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IndexMergerBase.makeProjections (cognitive 58) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:478— IndexMergerBase.makeProjections has cognitive complexity 58 (threshold 15). Drivers by points: loops 14 (35 pts), if/else 10 (23 pts) (nesting depth added 34). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ConciseSet.remove (cognitive 57) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:999— ConciseSet.remove has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (51 pts), boolean chains 5, loops 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArrayContainsOperatorConversion.toDruidFilter (cognitive 57) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:86— ArrayContainsOperatorConversion.toDruidFilter has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (32 pts), ternaries 3 (14 pts), loops 2 (8 pts), boolean chains 3 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
7383.call (cognitive 55) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:179— 7383.call has cognitive complexity 55 (threshold 15). Drivers by points: if/else 30 (39 pts), error handling 6, loops 4 (6 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ExprEval.coerceListToArray (cognitive 55) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:153— ExprEval.coerceListToArray has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (16 pts), ternaries 4 (14 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExpressionPlanner.plan (cognitive 54) processing/src/main/java/org/apache/druid/segment/virtual/ExpressionPlanner.java:54— ExpressionPlanner.plan has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 11, loops 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CostBasedAutoScaler.extractMovingAverage (cognitive 52) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:561— CostBasedAutoScaler.extractMovingAverage has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (47 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SqlScanner.scan (cognitive 52) jdbc-driver/src/main/java/org/apache/druid/jdbc/sql/SqlScanner.java:62— SqlScanner.scan has cognitive complexity 52 (threshold 15). Drivers by points: if/else 27 (39 pts), boolean chains 9, loops 2, ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConnectionUriUtils.tryParseJdbcUriParameters (cognitive 52) processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:100— ConnectionUriUtils.tryParseJdbcUriParameters has cognitive complexity 52 (threshold 15). Drivers by points: error handling 17 (46 pts), if/else 5 (6 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidQuery.computeVirtualColumns (cognitive 52) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:740— DruidQuery.computeVirtualColumns has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 9 (19 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputSourceSampler.sample (cognitive 51) indexing-service/src/main/java/org/apache/druid/indexing/overlord/sampler/InputSourceSampler.java:97— InputSourceSampler.sample has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 6 (8 pts), ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Projections.walkClusterGroupFilter (cognitive 51) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:863— Projections.walkClusterGroupFilter has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (41 pts), loops 3 (6 pts), ternaries 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrayOverlapOperatorConversion.toDruidFilter (cognitive 51) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayOverlapOperatorConversion.java:86— ArrayOverlapOperatorConversion.toDruidFilter has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 1 (4 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NodeRoleWatcher.watch (cognitive 51) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:220— NodeRoleWatcher.watch has cognitive complexity 51 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 6 (16 pts), error handling 3 (12 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkbenchQuery.getApiQuery (cognitive 51) web-console/src/druid-models/workbench-query/workbench-query.ts:503— WorkbenchQuery.getApiQuery has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 9, error handling 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSet.add (cognitive 50) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:904— ConciseSet.add has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (43 pts), boolean chains 6, loops 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ExprEval.bestEffortOf (cognitive 50) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:403— ExprEval.bestEffortOf has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (19 pts), loops 9 (18 pts), ternaries 4 (11 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeekableStreamSupervisor.createNewTasks (cognitive 49) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4516— SeekableStreamSupervisor.createNewTasks has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (33 pts), ternaries 2 (7 pts), boolean chains 6, loops 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HttpRemoteTaskRunner.taskAddedOrUpdated (cognitive 49) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1445— HttpRemoteTaskRunner.taskAddedOrUpdated has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (38 pts), match/switch 4 (11 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonConfigurator.configurate (cognitive 49) processing/src/main/java/org/apache/druid/guice/JsonConfigurator.java:94— JsonConfigurator.configurate has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (26 pts), error handling 4 (8 pts), loops 3 (6 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DependencyReportParser.handle_starttag (cognitive 49) distribution/bin/check-licenses.py:61— DependencyReportParser.handle_starttag has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (39 pts), loops 2 (6 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryManager.run (cognitive 49) web-console/src/utils/query-manager/query-manager.ts:125— QueryManager.run has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 6, error handling 3 (5 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExprEval.ofType (cognitive 47) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:522— ExprEval.ofType has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 3 (9 pts), error handling 1 (3 pts), match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HttpRemoteTaskRunner.pendingTasksExecutionLoop (cognitive 46) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1091— HttpRemoteTaskRunner.pendingTasksExecutionLoop has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (33 pts), error handling 4 (8 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqlResults.coerce (cognitive 46) sql/src/main/java/org/apache/druid/sql/calcite/run/SqlResults.java:53— SqlResults.coerce has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31 (39 pts), error handling 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MoveTimeFiltersToIntervals.extractConvertibleTimeBounds (cognitive 45) sql/src/main/java/org/apache/druid/sql/calcite/filtration/MoveTimeFiltersToIntervals.java:92— MoveTimeFiltersToIntervals.extractConvertibleTimeBounds has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (35 pts), ternaries 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate-binary-license.print_license (cognitive 45) distribution/bin/generate-binary-license.py:91— generate-binary-license.print_license has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 5 (14 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskLockbox.createOrFindLockPosse (cognitive 44) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:564— TaskLockbox.createOrFindLockPosse has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 7, ternaries 1 (4 pts), error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FirstLastVectorAggregator.aggregate (cognitive 44) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java:72— FirstLastVectorAggregator.aggregate has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ConsulLeaderSelector.leaderElectionLoop (cognitive 44) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulLeaderSelector.java:228— ConsulLeaderSelector.leaderElectionLoop has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (31 pts), error handling 3 (7 pts), boolean chains 5, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
refresh-license-versions.refresh_versions (cognitive 44) distribution/bin/refresh-license-versions.py:76— refresh-license-versions.refresh_versions has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 7 (10 pts), boolean chains 5 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SuperSorter.runNextMiddleMerger (cognitive 43) processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java:570— SuperSorter.runNextMiddleMerger has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 3 (8 pts), boolean chains 6 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApproximateHistogram.ruleCombineBins (cognitive 43) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:671— ApproximateHistogram.ruleCombineBins has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 7, loops 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskLockbox.revokeAllIncompatibleActiveLocksIfPossible (cognitive 42) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1582— TaskLockbox.revokeAllIncompatibleActiveLocksIfPossible has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (33 pts), boolean chains 5, loops 2, match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkerImpl.runInternal (cognitive 42) multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerImpl.java:258— WorkerImpl.runInternal has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 5 (11 pts), boolean chains 5 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerQueryKernelUtils.computeStageGroups (cognitive 42) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernelUtils.java:96— ControllerQueryKernelUtils.computeStageGroups has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 6 (12 pts), boolean chains 6 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderUtils.getColumnsRequiredForIngestion (cognitive 42) server/src/main/java/org/apache/druid/segment/indexing/ReaderUtils.java:48— ReaderUtils.getColumnsRequiredForIngestion has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 5 (10 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColumnTree.getDerivedStateFromProps (cognitive 42) web-console/src/views/workbench-view/column-tree/column-tree.tsx:213— ColumnTree.getDerivedStateFromProps has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 20, if/else 7 (11 pts), ternaries 5 (11 pts) (nesting depth added 10). Most of this is not in the body itself: 12 of the 42 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 278, 236, 247, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SeekableStreamSupervisor.resetInternal (cognitive 41) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2218— SeekableStreamSupervisor.resetInternal has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (27 pts), error handling 1 (4 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerImpl.runInternal (cognitive 41) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:415— ControllerImpl.runInternal has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 5, error handling 4 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Batch.tryReleaseShared (cognitive 41) processing/src/main/java/org/apache/druid/java/util/emitter/core/Batch.java:266— Batch.tryReleaseShared has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (26 pts), ternaries 2 (9 pts), loops 3 (6 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
measure-menu.MeasureMenu (cognitive 41) web-console/src/views/explore-view/components/control-pane/measure-menu.tsx:56— measure-menu.MeasureMenu has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 17, if/else 9 (15 pts), ternaries 5 (6 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 23 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeekableStreamSupervisor.checkTaskDuration (cognitive 40) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:3938— SeekableStreamSupervisor.checkTaskDuration has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 5 (14 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionTask.createDataSchema (cognitive 40) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:835— CompactionTask.createDataSchema has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 4 (6 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InDimFilter.optimizeLookup (cognitive 40) processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:455— InDimFilter.optimizeLookup has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.run (cognitive 40) processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryRunnerFactory.java:75— 1.run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 5 (9 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (2793.run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
IndexOnlyExecutor.execute (cognitive 40) processing/src/main/java/org/apache/druid/query/search/UseIndexesStrategy.java:267— IndexOnlyExecutor.execute has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (35 pts), loops 2 (4 pts), error handling 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
2793.run (cognitive 40) processing/src/main/java/org/apache/druid/query/metadata/SegmentMetadataQueryRunnerFactory.java:75— 2793.run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 5 (9 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (1.run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
LoadDataView.renderConnectStep (cognitive 40) web-console/src/views/load-data-view/load-data-view.tsx:1290— LoadDataView.renderConnectStep has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 9 (14 pts), boolean chains 10 (nesting depth added 10). Of this number, 24 points are the body's own statements and 16 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentsView.renderSegmentsTable (cognitive 40) web-console/src/views/segments-view/segments-view.tsx:600— SegmentsView.renderSegmentsTable has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 14 (20 pts), boolean chains 13, if/else 4 (5 pts), error handling 1, match/switch 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 23 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FirstLastVectorAggregator.aggregate (cognitive 39) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java:150— FirstLastVectorAggregator.aggregate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (27 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProjectionFilterMatch.rewriteFilter (cognitive 39) processing/src/main/java/org/apache/druid/segment/projections/ProjectionFilterMatch.java:51— ProjectionFilterMatch.rewriteFilter has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ImmutableConciseSet.addAndCompact (cognitive 39) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:281— ImmutableConciseSet.addAndCompact has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExprEvalNumericBindingVector.getObjectVector (cognitive 39) processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalNumericBindingVector.java:99— ExprEvalNumericBindingVector.getObjectVector has cognitive complexity 39 (threshold 15). Drivers by points: loops 4 (16 pts), if/else 8 (13 pts), ternaries 2 (10 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DumpSegment.runBitmaps (cognitive 39) services/src/main/java/org/apache/druid/cli/DumpSegment.java:365— DumpSegment.runBitmaps has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (11 pts), ternaries 1 (5 pts), error handling 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DependencyReportParser.handle_endtag (cognitive 39) distribution/bin/check-licenses.py:118— DependencyReportParser.handle_endtag has cognitive complexity 39 (threshold 15). Drivers by points: if/else 25 (39 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-source-step.InputSourceStep (cognitive 39) web-console/src/views/workbench-view/input-source-step/input-source-step.tsx:79— input-source-step.InputSourceStep has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 10 (13 pts), boolean chains 7 (nesting depth added 10). Of this number, 18 points are the body's own statements and 21 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
102665.apply (cognitive 38) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2562— 102665.apply has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (11 pts), boolean chains 1, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BoundDimFilter.makeLongPredicateSupplier (cognitive 38) processing/src/main/java/org/apache/druid/query/filter/BoundDimFilter.java:364— BoundDimFilter.makeLongPredicateSupplier has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (30 pts), error handling 2 (8 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.doFilterSuper (cognitive 38) extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/KerberosAuthenticator.java:246— 1.doFilterSuper has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 5, error handling 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
control-pane.ControlPane (cognitive 38) web-console/src/views/explore-view/components/control-pane/control-pane.tsx:67— control-pane.ControlPane has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 12, if/else 6 (9 pts), match/switch 1 (nesting depth added 11). Most of this is not in the body itself: 2 of the 38 points are its own statements and the rest belongs to 8 function items inside it that branch (renderOptionsPropInput, a function literal at line 357, a function literal at line 249, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
module-pane.ModulePane (cognitive 38) web-console/src/views/explore-view/components/module-pane/module-pane.tsx:106— module-pane.ModulePane has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 9, ternaries 8, loops 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 14 of the 38 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 220, updateParameterValues, a function literal at line 331, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SeekableStreamSupervisor.generateReport (cognitive 37) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1738— SeekableStreamSupervisor.generateReport has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 6 (20 pts), loops 5 (9 pts), if/else 2 (7 pts), error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicAllocationTasksNotice.handle (cognitive 37) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:588— DynamicAllocationTasksNotice.handle has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParallelIndexPhaseRunner.run (cognitive 37) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexPhaseRunner.java:114— ParallelIndexPhaseRunner.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 1 (3 pts), boolean chains 2, loops 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BoundFilter.getBitmapColumnIndex (cognitive 37) processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java:75— BoundFilter.getBitmapColumnIndex has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IndexMergerBase.mergeIndexesAndWriteColumns (cognitive 37) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:763— IndexMergerBase.mergeIndexesAndWriteColumns has cognitive complexity 37 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 7 (13 pts), ternaries 2 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DataSourceCompactibleSegmentIterator.populateQueue (cognitive 37) server/src/main/java/org/apache/druid/server/compaction/DataSourceCompactibleSegmentIterator.java:124— DataSourceCompactibleSegmentIterator.populateQueue has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (17 pts), boolean chains 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ClientQuerySegmentWalker.inlineIfNecessary (cognitive 37) server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java:362— ClientQuerySegmentWalker.inlineIfNecessary has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FixedBucketsHistogramQuantileSqlAggregator.toDruidAggregation (cognitive 37) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:66— FixedBucketsHistogramQuantileSqlAggregator.toDruidAggregation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.hasNext (cognitive 37) extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/DefaultK8sApiClient.java:198— 1.hasNext has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (23 pts), error handling 2 (5 pts), ternaries 1 (5 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SeekableStreamSupervisor.checkPendingCompletionTasks (cognitive 36) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4279— SeekableStreamSupervisor.checkPendingCompletionTasks has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeekableStreamIndexTaskRunner.setEndOffsets (cognitive 36) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:2012— SeekableStreamIndexTaskRunner.setEndOffsets has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 3, loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionTask.createInputDataSchemas (cognitive 36) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:637— CompactionTask.createInputDataSchemas has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 3 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelStageOutputReader.readRemotelyFrom (cognitive 36) multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/ChannelStageOutputReader.java:121— ChannelStageOutputReader.readRemotelyFrom has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 3 (13 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashAggregateIterator.aggregateMultiValueDims (cognitive 36) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java:603— HashAggregateIterator.aggregateMultiValueDims has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (13 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoTypeColumnMerger.writeMergedValueDictionary (cognitive 36) processing/src/main/java/org/apache/druid/segment/AutoTypeColumnMerger.java:127— AutoTypeColumnMerger.writeMergedValueDictionary has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 14, match/switch 1 (2 pts), ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultOperandTypeChecker.checkOperandTypes (cognitive 36) sql/src/main/java/org/apache/druid/sql/calcite/expression/DefaultOperandTypeChecker.java:98— DefaultOperandTypeChecker.checkOperandTypes has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 1 (5 pts), boolean chains 4, loops 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
time-manipulation.shiftBackAndExpandTimeInExpression (cognitive 36) web-console/src/views/explore-view/utils/time-manipulation.ts:112— time-manipulation.shiftBackAndExpandTimeInExpression has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 7 (nesting depth added 19). None of this is in the body itself: all 36 points belong to one function literal inside it that branches (line 117). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
services-view.DetailCell (cognitive 36) web-console/src/views/services-view/services-view.tsx:254— services-view.DetailCell has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 4, ternaries 1 (2 pts), match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
NestedFieldDictionaryEncodedColumn.getIdFromGlobalDictionary (cognitive 35) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:210— NestedFieldDictionaryEncodedColumn.getIdFromGlobalDictionary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NestedFieldVirtualColumn.getIndexSupplier (cognitive 35) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:680— NestedFieldVirtualColumn.getIndexSupplier has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
segment-timeline.SegmentTimeline (cognitive 35) web-console/src/components/segment-timeline/segment-timeline.tsx:81— segment-timeline.SegmentTimeline has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 10, ternaries 8 (9 pts) (nesting depth added 4). Of this number, 17 points are the body's own statements and 18 belong to 7 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ByteBufferMinMaxOffsetHeap.siftDown (cognitive 34) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:299— ByteBufferMinMaxOffsetHeap.siftDown has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (30 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HavingSpecMetricComparator.compare (cognitive 34) processing/src/main/java/org/apache/druid/query/groupby/having/HavingSpecMetricComparator.java:40— HavingSpecMetricComparator.compare has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 8 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LazilyDecoratedRowsAndColumns.naiveMaterialize (cognitive 34) processing/src/main/java/org/apache/druid/query/rowsandcols/LazilyDecoratedRowsAndColumns.java:295— LazilyDecoratedRowsAndColumns.naiveMaterialize has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Projections.matchAggregators (cognitive 34) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:391— Projections.matchAggregators has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSet.performOperation (cognitive 34) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:626— ConciseSet.performOperation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 1, loops 1, match/switch 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadableByteChunksFrameChannel.updateStreamState (cognitive 34) processing/src/main/java/org/apache/druid/frame/channel/ReadableByteChunksFrameChannel.java:396— ReadableByteChunksFrameChannel.updateStreamState has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 6 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrameChannelMerger.writeNextFrameWithCombiner (cognitive 34) processing/src/main/java/org/apache/druid/frame/processor/FrameChannelMerger.java:302— FrameChannelMerger.writeNextFrameWithCombiner has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentLocalCacheManager.realizeRuleOrRestorePrior (cognitive 34) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1139— SegmentLocalCacheManager.realizeRuleOrRestorePrior has cognitive complexity 34 (threshold 15). Drivers by points: error handling 8 (18 pts), ternaries 3 (8 pts), if/else 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollectComparisons.collect (cognitive 34) sql/src/main/java/org/apache/druid/sql/calcite/filtration/CollectComparisons.java:61— CollectComparisons.collect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoForm.issueWithModel (cognitive 34) web-console/src/components/auto-form/auto-form.tsx:161— AutoForm.issueWithModel has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 2, boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
continuous-chart-single-render.ContinuousChartSingleRender (cognitive 34) web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-single-render.tsx:70— continuous-chart-single-render.ContinuousChartSingleRender has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 20, if/else 6 (7 pts), loops 4 (7 pts) (nesting depth added 4). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 91, startEndToXWidth, datumToCxCy, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
schema-table.SchemaTable (cognitive 34) web-console/src/views/load-data-view/schema-table/schema-table.tsx:61— schema-table.SchemaTable has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 12 (22 pts), boolean chains 6, if/else 5 (6 pts) (nesting depth added 11). None of this is in the body itself: all 34 points belong to 5 function literals inside it that branch (lines 82, 139, 107, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Metadata.merge (cognitive 33) processing/src/main/java/org/apache/druid/segment/Metadata.java:207— Metadata.merge has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 4, boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Stages.getByPartitionCountersForStage (cognitive 33) web-console/src/druid-models/stages/stages.ts:745— Stages.getByPartitionCountersForStage has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (11 pts), loops 5 (9 pts) (nesting depth added 8). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schema-step.getTimeSuggestions (cognitive 33) web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:142— schema-step.getTimeSuggestions has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 6 (15 pts), match/switch 1 (2 pts) (nesting depth added 18). Most of this is not in the body itself: 15 of the 33 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 185, 167, 198, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
run-panel.RunPanel (cognitive 33) web-console/src/views/workbench-view/run-panel/run-panel.tsx:184— run-panel.RunPanel has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 28, ternaries 3, if/else 2. Of this number, 31 points are the body's own statements and 2 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CostBasedAutoScaler.computeOptimalTaskCountInternal (cognitive 32) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:277— CostBasedAutoScaler.computeOptimalTaskCountInternal has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerStageTracker.addPartialKeyInformationForWorker (cognitive 32) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:417— ControllerStageTracker.addPartialKeyInformationForWorker has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 2, error handling 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NestedFieldColumnIndexSupplier.as (cognitive 32) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:149— NestedFieldColumnIndexSupplier.as has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (29 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VariantColumnSerializer.closeForWrite (cognitive 32) processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:301— VariantColumnSerializer.closeForWrite has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 5 (13 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Projections.matchQueryVirtualColumn (cognitive 32) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:511— Projections.matchQueryVirtualColumn has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringDimensionIndexer.processRowValsToUnsortedEncodedKeyComponent (cognitive 32) processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:133— StringDimensionIndexer.processRowValsToUnsortedEncodedKeyComponent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (6 pts), ternaries 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.channelRead0 (cognitive 32) processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java:246— 1.channelRead0 has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 2, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalsResource.getSpecificIntervals (cognitive 32) server/src/main/java/org/apache/druid/server/http/IntervalsResource.java:94— IntervalsResource.getSpecificIntervals has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 6 (13 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataSchema.validateProjections (cognitive 32) server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java:566— DataSchema.validateProjections has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 3 (8 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DumpSegment.runDumpNestedColumnPath (cognitive 32) services/src/main/java/org/apache/druid/cli/DumpSegment.java:565— DumpSegment.runDumpNestedColumnPath has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (13 pts), error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialDruidQuery.getTraitSet (cognitive 32) sql/src/main/java/org/apache/druid/sql/calcite/rel/PartialDruidQuery.java:461— PartialDruidQuery.getTraitSet has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (12 pts), boolean chains 2, match/switch 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
KafkaConsumerMonitor.doMonitor (cognitive 32) extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaConsumerMonitor.java:158— KafkaConsumerMonitor.doMonitor has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (5 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql-completions.getSqlCompletions (cognitive 32) web-console/src/editor-completions/sql-completions.ts:236— sql-completions.getSqlCompletions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 12, ternaries 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerQueryKernel.registerStagePhaseChange (cognitive 31) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernel.java:755— ControllerQueryKernel.registerStagePhaseChange has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerStageTracker.generateResultPartitionsAndBoundariesWithoutKeyStatistics (cognitive 31) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:960— ControllerStageTracker.generateResultPartitionsAndBoundariesWithoutKeyStatistics has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (10 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanQueryFrameProcessor.runWithSegment (cognitive 31) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryFrameProcessor.java:326— ScanQueryFrameProcessor.runWithSegment has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OvershadowableManager.addChunk (cognitive 31) processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:657— OvershadowableManager.addChunk has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlphanumericComparator.compareNumbers (cognitive 31) processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:154— AlphanumericComparator.compareNumbers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, loops 3, ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontCodedIndexed.indexOf (cognitive 31) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:228— FrontCodedIndexed.indexOf has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (25 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontCodedIntArrayIndexed.indexOf (cognitive 31) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:170— FrontCodedIntArrayIndexed.indexOf has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (25 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnHeapAggregateProjection.initializeAndValidateAggregators (cognitive 31) processing/src/main/java/org/apache/druid/segment/incremental/OnHeapAggregateProjection.java:462— OnHeapAggregateProjection.initializeAndValidateAggregators has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
8.computeNumbers (cognitive 31) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:858— 8.computeNumbers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 1 (6 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArrayElementLongVectorValueSelector.computeNumbers (cognitive 31) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1300— ArrayElementLongVectorValueSelector.computeNumbers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 1 (6 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (ArrayElementFloatVectorValueSelector.computeNumbers, ArrayElementDoubleVectorValueSelector.computeNumbers) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ArrayElementFloatVectorValueSelector.computeNumbers (cognitive 31) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1389— ArrayElementFloatVectorValueSelector.computeNumbers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 1 (6 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (ArrayElementLongVectorValueSelector.computeNumbers, ArrayElementDoubleVectorValueSelector.computeNumbers) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ArrayElementDoubleVectorValueSelector.computeNumbers (cognitive 31) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:1476— ArrayElementDoubleVectorValueSelector.computeNumbers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 1 (6 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (ArrayElementLongVectorValueSelector.computeNumbers, ArrayElementFloatVectorValueSelector.computeNumbers) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
IndexMergerV10.makeClusteredIndexFiles (cognitive 31) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:359— IndexMergerV10.makeClusteredIndexFiles has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 7 (11 pts), ternaries 3 (7 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
2.updateCurrentValues (cognitive 31) processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java:385— 2.updateCurrentValues has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2 (6 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerManager.getOrLoadSegmentReferences (cognitive 31) server/src/main/java/org/apache/druid/server/ServerManager.java:291— ServerManager.getOrLoadSegmentReferences has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 3 (5 pts), ternaries 4 (5 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentLocalCacheManager.acquireCachedInternal (cognitive 31) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:556— SegmentLocalCacheManager.acquireCachedInternal has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 7, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamAppenderator.add (cognitive 31) server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:305— StreamAppenderator.add has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BottomUpTransform.apply0 (cognitive 31) sql/src/main/java/org/apache/druid/sql/calcite/filtration/BottomUpTransform.java:56— BottomUpTransform.apply0 has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (27 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidCorrelateUnnestRel.toDruidQuery (cognitive 31) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:148— DruidCorrelateUnnestRel.toDruidQuery has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
KafkaLookupExtractorFactory.start (cognitive 31) extensions-core/kafka-extraction-namespace/src/main/java/org/apache/druid/query/lookup/KafkaLookupExtractorFactory.java:155— KafkaLookupExtractorFactory.start has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, loops 3 (4 pts), error handling 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql-task-execution.getTaskExecution (cognitive 31) web-console/src/helpers/execution/sql-task-execution.ts:161— sql-task-execution.getTaskExecution has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 4 (9 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cell-filter-menu.CellFilterMenu (cognitive 31) web-console/src/components/cell-filter-menu/cell-filter-menu.tsx:88— cell-filter-menu.CellFilterMenu has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (9 pts), boolean chains 7 (nesting depth added 11). Of this number, 25 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
external-config.summarizeInputSource (cognitive 31) web-console/src/druid-models/external-config/external-config.ts:55— external-config.summarizeInputSource has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 3, ternaries 1 (2 pts), match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
time-chart-module.getRangeInExpression (cognitive 31) web-console/src/views/explore-view/modules/time-chart-module/time-chart-module.tsx:60— time-chart-module.getRangeInExpression has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 4 (12 pts), boolean chains 6, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeekableStreamSupervisor.verifyAndMergeCheckpoints (cognitive 30) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2875— SeekableStreamSupervisor.verifyAndMergeCheckpoints has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 10, loops 3 (4 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupByPreShuffleStageProcessor.filterBaseInput (cognitive 30) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPreShuffleStageProcessor.java:117— GroupByPreShuffleStageProcessor.filterBaseInput has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColumnType.leastRestrictiveType (cognitive 30) processing/src/main/java/org/apache/druid/segment/column/ColumnType.java:162— ColumnType.leastRestrictiveType has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncrementalIndex.toIncrementalIndexRow (cognitive 30) processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java:490— IncrementalIndex.toIncrementalIndexRow has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashJoinSegmentCursorFactory.planJoinCursor (cognitive 30) processing/src/main/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactory.java:160— HashJoinSegmentCursorFactory.planJoinCursor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 5 (12 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NestedFieldVirtualColumn.makeVectorValueSelector (cognitive 30) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:598— NestedFieldVirtualColumn.makeVectorValueSelector has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSet.contains (cognitive 30) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1095— ConciseSet.contains has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadableInputStreamFrameChannel.startReading (cognitive 30) processing/src/main/java/org/apache/druid/frame/channel/ReadableInputStreamFrameChannel.java:163— ReadableInputStreamFrameChannel.startReading has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidQuery.toTimeseriesQuery (cognitive 30) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1146— DruidQuery.toTimeseriesQuery has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pac4jSessionStore.getCookie (cognitive 30) REDACTED:318— Pac4jSessionStore.getCookie has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 2 (6 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
link-lint.entries.forEach() (cognitive 30) website/script/link-lint.js:31— link-lint.entries.forEach() has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to one function literal inside it that branches (line 36). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
MSQErrorReport.getFaultFromException (cognitive 29) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/MSQErrorReport.java:219— MSQErrorReport.getFaultFromException has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkerInputs.create (cognitive 29) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/WorkerInputs.java:61— WorkerInputs.create has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 7 (11 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionedIntervalTimeline.isOvershadowed (cognitive 29) processing/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java:516— VersionedIntervalTimeline.isOvershadowed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FastLineIterator.readNextLine (cognitive 29) processing/src/main/java/org/apache/druid/data/input/impl/FastLineIterator.java:121— FastLineIterator.readNextLine has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (7 pts), error handling 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypedInFilter.createStringPredicate (cognitive 29) processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:533— TypedInFilter.createStringPredicate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 4 (8 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExpressionPlan.inferColumnCapabilities (cognitive 29) processing/src/main/java/org/apache/druid/segment/virtual/ExpressionPlan.java:235— ExpressionPlan.inferColumnCapabilities has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IndexMergerV10.makeIndexFiles (cognitive 29) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:98— IndexMergerV10.makeIndexFiles has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 7 (11 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringDimensionIndexer.compareUnsortedEncodedKeyComponents (cognitive 29) processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:229— StringDimensionIndexer.compareUnsortedEncodedKeyComponents has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (11 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FrameProcessorExecutor.logProcessorStatusString (cognitive 29) processing/src/main/java/org/apache/druid/frame/processor/FrameProcessorExecutor.java:742— FrameProcessorExecutor.logProcessorStatusString has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 3 (12 pts), if/else 4 (9 pts), loops 2 (8 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AppendableByteArrayInputStream.scanThroughBytesAndDoSomething (cognitive 29) processing/src/main/java/org/apache/druid/java/util/http/client/io/AppendableByteArrayInputStream.java:140— AppendableByteArrayInputStream.scanThroughBytesAndDoSomething has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (24 pts), error handling 1 (4 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BasicDataSourceExt.createConnectionFactory (cognitive 29) server/src/main/java/org/apache/druid/metadata/BasicDataSourceExt.java:112— BasicDataSourceExt.createConnectionFactory has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 3 (8 pts), ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialSegmentBundleCacheEntry.doMount (cognitive 29) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:392— PartialSegmentBundleCacheEntry.doMount has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (9 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentLocalCacheManager.bootstrap (cognitive 29) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1443— SegmentLocalCacheManager.bootstrap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 1 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseAppenderatorDriver.publishInBackground (cognitive 29) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java:585— BaseAppenderatorDriver.publishInBackground has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SinkSchemaUtil.computeSchemaChange (cognitive 29) server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkSchemaUtil.java:91— SinkSchemaUtil.computeSchemaChange has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeQueryMaker.runQuery (cognitive 29) sql/src/main/java/org/apache/druid/sql/calcite/run/NativeQueryMaker.java:81— NativeQueryMaker.runQuery has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
KafkaEmitter.emit (cognitive 29) extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitter.java:253— KafkaEmitter.emit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatsDEmitter.emitMetric (cognitive 29) extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/StatsDEmitter.java:115— StatsDEmitter.emitMetric has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (6 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HllSketchSetUnionOperatorConversion.toPostAggregator (cognitive 29) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSetUnionOperatorConversion.java:79— HllSketchSetUnionOperatorConversion.toPostAggregator has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 2 (8 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
explore-view.ExploreView (cognitive 29) web-console/src/views/explore-view/explore-view.tsx:114— explore-view.ExploreView has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 17, if/else 10, ternaries 2. Of this number, 16 points are the body's own statements and 13 belong to 12 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sql-data-loader-view.SqlDataLoaderView (cognitive 29) web-console/src/views/sql-data-loader-view/sql-data-loader-view.tsx:68— sql-data-loader-view.SqlDataLoaderView has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 5 (10 pts), boolean chains 7, error handling 1 (nesting depth added 11). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 148, submitTask). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SeekableStreamSupervisor.updatePartitionDataFromStream (cognitive 28) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:3395— SeekableStreamSupervisor.updatePartitionDataFromStream has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (6 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentGenerationUtils.makeDimensionsAndAggregatorsForIngestion (cognitive 28) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/SegmentGenerationUtils.java:299— SegmentGenerationUtils.makeDimensionsAndAggregatorsForIngestion has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 5 (9 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortMergeJoinFrameProcessor.advanceTrackersAfterEmittingRow (cognitive 28) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessor.java:291— SortMergeJoinFrameProcessor.advanceTrackersAfterEmittingRow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusteredValueGroupsBaseTableSchema.<init> (cognitive 28) processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:74— ClusteredValueGroupsBaseTableSchema.<init> has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4, ternaries 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReservoirSegmentSampler.getRandomBalancerSegmentHolder (cognitive 28) server/src/main/java/org/apache/druid/server/coordinator/balancer/ReservoirSegmentSampler.java:111— ReservoirSegmentSampler.getRandomBalancerSegmentHolder has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidNode.init (cognitive 28) server/src/main/java/org/apache/druid/server/DruidNode.java:192— DruidNode.init has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsyncQueryForwardingServlet.service (cognitive 28) services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java:214— AsyncQueryForwardingServlet.service has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 4 (8 pts), boolean chains 4, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchOperatorConversion.expandSearch (cognitive 28) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/SearchOperatorConversion.java:114— SearchOperatorConversion.expandSearch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 2 (4 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidJoinRule.analyzeCondition (cognitive 28) sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidJoinRule.java:432— DruidJoinRule.analyzeCondition has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BloomFilterSqlAggregator.toDruidAggregation (cognitive 28) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregator.java:64— BloomFilterSqlAggregator.toDruidAggregation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuantileSqlAggregator.toDruidAggregation (cognitive 28) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:68— QuantileSqlAggregator.toDruidAggregation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ingest-query-pattern.fitIngestQueryPattern (cognitive 28) web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts:140— ingest-query-pattern.fitIngestQueryPattern has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23 (26 pts), boolean chains 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
execution-submit-dialog.ExecutionSubmitDialog::handleSubmit (cognitive 28) web-console/src/views/workbench-view/execution-submit-dialog/execution-submit-dialog.tsx:59— execution-submit-dialog.ExecutionSubmitDialog::handleSubmit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 3 (5 pts), ternaries 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerImpl.generateSegmentIdsWithShardSpecsForReplace (cognitive 27) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1294— ControllerImpl.generateSegmentIdsWithShardSpecsForReplace has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (8 pts), loops 3 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunWorkOrder.stop (cognitive 27) multi-stage-query/src/main/java/org/apache/druid/msq/exec/RunWorkOrder.java:195— RunWorkOrder.stop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 4 (8 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
7.match (cognitive 27) processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:396— 7.match has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1ExecutorRunnable.run (cognitive 27) processing/src/main/java/org/apache/druid/frame/processor/FrameProcessorExecutor.java:130— 1ExecutorRunnable.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 1 (3 pts), boolean chains 2, error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PeriodGranularity.canBeMappedTo (cognitive 27) processing/src/main/java/org/apache/druid/java/util/common/granularity/PeriodGranularity.java:250— PeriodGranularity.canBeMappedTo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientCompactionRunnerInfo.validatePartitionsSpecForMSQ (cognitive 27) server/src/main/java/org/apache/druid/client/indexing/ClientCompactionRunnerInfo.java:177— ClientCompactionRunnerInfo.validatePartitionsSpecForMSQ has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexerSQLMetadataStorageCoordinator.createNewSegmentsAfterReplace (cognitive 27) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1896— IndexerSQLMetadataStorageCoordinator.createNewSegmentsAfterReplace has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (4 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamAppenderator.bootstrapSinksFromDisk (cognitive 27) server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:1357— StreamAppenderator.bootstrapSinksFromDisk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CastOperatorConversion.toDruidExpression (cognitive 27) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/CastOperatorConversion.java:57— CastOperatorConversion.toDruidExpression has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expressions.calciteLiteralToDruidLiteral (cognitive 27) sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:327— Expressions.calciteLiteralToDruidLiteral has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 4 (8 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidQuery.toGroupByQuery (cognitive 27) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1373— DruidQuery.toGroupByQuery has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KafkaEmitterConfig.equals (cognitive 27) extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitterConfig.java:275— KafkaEmitterConfig.equals has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, ternaries 6 (12 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MovingAverageIterator.internalNext (cognitive 27) extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageIterable.java:197— MovingAverageIterator.internalNext has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HllSketchBaseSqlAggregator.toDruidAggregation (cognitive 27) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:68— HllSketchBaseSqlAggregator.toDruidAggregation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retention-dialog.RetentionDialog (cognitive 27) web-console/src/dialogs/retention-dialog/retention-dialog.tsx:49— retention-dialog.RetentionDialog has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (21 pts), boolean chains 3, if/else 3 (nesting depth added 10). Of this number, 15 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
filter-pane.FilterPane (cognitive 27) web-console/src/views/explore-view/components/filter-pane/filter-pane.tsx:63— filter-pane.FilterPane has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (16 pts), if/else 9, boolean chains 2 (nesting depth added 7). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 136, filterTooltip, a function literal at line 80, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SeekableStreamSupervisor.getOffsetFromStorageForPartition (cognitive 26) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4787— SeekableStreamSupervisor.getOffsetFromStorageForPartition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (26 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TaskLockbox.unlock (cognitive 26) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1115— TaskLockbox.unlock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, error handling 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LikeMatcher.from (cognitive 26) processing/src/main/java/org/apache/druid/query/filter/LikeDimFilter.java:289— LikeMatcher.from has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorGroupByEngineIterator.initNewDelegate (cognitive 26) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/VectorGroupByEngine.java:366— VectorGroupByEngineIterator.initNewDelegate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (6 pts), ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrayAggregateIterator.aggregateMultiValueDimsWithIntGrouper (cognitive 26) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java:787— ArrayAggregateIterator.aggregateMultiValueDimsWithIntGrouper has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentAnalyzer.analyzeStringColumn (cognitive 26) processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java:204— SegmentAnalyzer.analyzeStringColumn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrameChannelMerger.writeNextFrameNoCombiner (cognitive 26) processing/src/main/java/org/apache/druid/frame/processor/FrameChannelMerger.java:241— FrameChannelMerger.writeNextFrameNoCombiner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeCombineAction.compute (cognitive 26) processing/src/main/java/org/apache/druid/java/util/common/guava/ParallelMergeCombiningSequence.java:572— MergeCombineAction.compute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExpressionTypeConversion.leastRestrictiveType (cognitive 26) processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeConversion.java:162— ExpressionTypeConversion.leastRestrictiveType has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialSegmentMetadataCacheEntry.applyRule (cognitive 26) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:313— PartialSegmentMetadataCacheEntry.applyRule has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 5, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sink.makeNewCurrIndex (cognitive 26) server/src/main/java/org/apache/druid/segment/realtime/sink/Sink.java:315— Sink.makeNewCurrIndex has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (5 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RollupTableBaseTableMetadata.createSpec (cognitive 26) server/src/main/java/org/apache/druid/catalog/model/RollupTableBaseTableMetadata.java:121— RollupTableBaseTableMetadata.createSpec has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 4, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TieredBrokerHostSelector.select (cognitive 26) services/src/main/java/org/apache/druid/server/router/TieredBrokerHostSelector.java:185— TieredBrokerHostSelector.select has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Grouping.applyProject (cognitive 26) sql/src/main/java/org/apache/druid/sql/calcite/rel/Grouping.java:211— Grouping.applyProject has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (12 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fancy-numeric-input.FancyNumericInput (cognitive 26) web-console/src/components/fancy-numeric-input/fancy-numeric-input.tsx:86— fancy-numeric-input.FancyNumericInput has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, if/else 11, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 192, a function literal at line 176, increment, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SeekableStreamIndexTaskTuningConfig.<init> (cognitive 25) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTuningConfig.java:131— SeekableStreamIndexTaskTuningConfig.<init> has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 18 (21 pts), if/else 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
InputRowSchemas.createColumnsFilter (cognitive 25) indexing-service/src/main/java/org/apache/druid/indexing/input/InputRowSchemas.java:71— InputRowSchemas.createColumnsFilter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (12 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MSQTaskSqlEngine.validateTypeChanges (cognitive 25) multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java:386— MSQTaskSqlEngine.validateTypeChanges has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 7, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SequenceOperator.goOrContinue (cognitive 25) processing/src/main/java/org/apache/druid/query/operator/SequenceOperator.java:47— SequenceOperator.goOrContinue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (6 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConcatRowsAndColumns.findColumn (cognitive 25) processing/src/main/java/org/apache/druid/query/rowsandcols/ConcatRowsAndColumns.java:96— ConcatRowsAndColumns.findColumn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HiveCnfHelper.flatten (cognitive 25) processing/src/main/java/org/apache/druid/segment/filter/cnf/HiveCnfHelper.java:140— HiveCnfHelper.flatten has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompressedNestedDataComplexColumn.readNestedFieldColumn (cognitive 25) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:1082— CompressedNestedDataComplexColumn.readNestedFieldColumn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 5 (6 pts), boolean chains 1, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
VariantColumnSerializer.serialize (cognitive 25) processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java:238— VariantColumnSerializer.serialize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Projections.buildClusterVirtualColumnRemap (cognitive 25) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:758— Projections.buildClusterVirtualColumnRemap has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5 (6 pts), boolean chains 3, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExpressionSelectors.createBindings (cognitive 25) processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java:281— ExpressionSelectors.createBindings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NestedFieldVirtualColumn.makeVectorObjectSelector (cognitive 25) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:510— NestedFieldVirtualColumn.makeVectorObjectSelector has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 4 (10 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexMergerV9.makeIndexFiles (cognitive 25) processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java:117— IndexMergerV9.makeIndexFiles has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (8 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunAllFullyRunnable.run (cognitive 25) processing/src/main/java/org/apache/druid/frame/processor/RunAllFullyWidget.java:179— RunAllFullyRunnable.run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HumanReadableBytes.parseInner (cognitive 25) processing/src/main/java/org/apache/druid/java/util/common/HumanReadableBytes.java:143— HumanReadableBytes.parseInner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 5 (10 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LookupCoordinatorManager.updateLookups (cognitive 25) server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java:187— LookupCoordinatorManager.updateLookups has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryResultPusher.push (cognitive 25) server/src/main/java/org/apache/druid/server/QueryResultPusher.java:125— QueryResultPusher.push has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 6 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonParserIterator.init (cognitive 25) server/src/main/java/org/apache/druid/client/JsonParserIterator.java:177— JsonParserIterator.init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (6 pts), ternaries 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialDruidQuery.estimateCost (cognitive 25) sql/src/main/java/org/apache/druid/sql/calcite/rel/PartialDruidQuery.java:635— PartialDruidQuery.estimateCost has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidAggregateCaseToFilterRule.transform (cognitive 25) sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidAggregateCaseToFilterRule.java:137— DruidAggregateCaseToFilterRule.transform has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 8, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GroupByRules.translateAggregateCall (cognitive 25) sql/src/main/java/org/apache/druid/sql/calcite/rule/GroupByRules.java:58— GroupByRules.translateAggregateCall has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DoublesSketchApproxQuantileSqlAggregator.toDruidAggregation (cognitive 25) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:85— DoublesSketchApproxQuantileSqlAggregator.toDruidAggregation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CachingKubernetesPeonClient.waitUntilPeonPodCreatedAndReady (cognitive 25) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/CachingKubernetesPeonClient.java:160— CachingKubernetesPeonClient.waitUntilPeonPodCreatedAndReady has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 3 (6 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MySQLConnector.<init> (cognitive 25) extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/mysql/MySQLConnector.java:65— MySQLConnector.<init> has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (25 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerSideEncryptingAmazonS3.builder (cognitive 25) extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java:318— ServerSideEncryptingAmazonS3.builder has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rule-editor.RuleEditor (cognitive 25) web-console/src/components/rule-editor/rule-editor.tsx:52— rule-editor.RuleEditor has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (10 pts), loops 2 (3 pts), ternaries 2 (nesting depth added 4). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (addTier, renderTiers, a function literal at line 107, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
execution-stages-pane.ExecutionStagesPane (cognitive 25) web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx:183— execution-stages-pane.ExecutionStagesPane has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 52, if/else 27, ternaries 16 (18 pts), loops 1, match/switch 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (execution-stages-pane.ExecutionStagesPane::detailedCountersForWorkers) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DatasourcesView.getDatasourceActions (cognitive 25) web-console/src/views/datasources-view/datasources-view.tsx:1000— DatasourcesView.getDatasourceActions has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 4 (7 pts), boolean chains 2 (nesting depth added 11). Of this number, 21 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
174342.apply (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4154— 174342.apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (6 pts), boolean chains 3, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeekableStreamSupervisorIOConfig.<init> (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisorIOConfig.java:72— SeekableStreamSupervisorIOConfig.<init> has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 5 (6 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
OverlordResource.getTaskStatus (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:298— OverlordResource.getTaskStatus has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 5 (9 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WorkerSelectUtils.selectWorker (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/WorkerSelectUtils.java:106— WorkerSelectUtils.selectWorker has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TaskLockbox.tryLock (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:407— TaskLockbox.tryLock has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskQueue.startPendingTaskOnRunner (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java:437— TaskQueue.startPendingTaskOnRunner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RetrieveUsedSegmentsAction.retrieveSegments (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/RetrieveUsedSegmentsAction.java:167— RetrieveUsedSegmentsAction.retrieveSegments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExistingSegmentAnalyzer.processProjections (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:1520— ExistingSegmentAnalyzer.processProjections has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexTuningConfig.<init> (cognitive 24) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1338— IndexTuningConfig.<init> has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 16 (19 pts), if/else 4, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IndexerDataServerQueryHandler.fetchRowsFromDataServer (cognitive 24) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerDataServerQueryHandler.java:161— IndexerDataServerQueryHandler.fetchRowsFromDataServer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerStageTracker.mergeClusterByStatisticsCollectorForTimeChunk (cognitive 24) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:536— ControllerStageTracker.mergeClusterByStatisticsCollectorForTimeChunk has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 3, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Rows.objectToNumber (cognitive 24) processing/src/main/java/org/apache/druid/data/input/Rows.java:114— Rows.objectToNumber has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
1.match (cognitive 24) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:131— 1.match has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ByteBufferMinMaxOffsetHeap.bubbleUp (cognitive 24) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:236— ByteBufferMinMaxOffsetHeap.bubbleUp has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (24 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentAnalyzer.analyze (cognitive 24) processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java:90— SegmentAnalyzer.analyze has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (9 pts), error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowValueProcessorBase.computeFirstOrLastValueFramed (cognitive 24) processing/src/main/java/org/apache/druid/query/operator/window/value/WindowValueProcessorBase.java:122— WindowValueProcessorBase.computeFirstOrLastValueFramed has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (8 pts), ternaries 2 (8 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowOperatorQuery.<init> (cognitive 24) processing/src/main/java/org/apache/druid/query/operator/WindowOperatorQuery.java:90— WindowOperatorQuery.<init> has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (9 pts), loops 1 (4 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SearchStrategy.getDimsToSearch (cognitive 24) processing/src/main/java/org/apache/druid/query/search/SearchStrategy.java:61— SearchStrategy.getDimsToSearch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (10 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontCodedV1.findInBucket (cognitive 24) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:674— FrontCodedV1.findInBucket has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontCodedIntArrayIndexed.findValueInBucket (cognitive 24) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:398— FrontCodedIntArrayIndexed.findValueInBucket has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Filters.checkFilterTuningUseIndex (cognitive 24) processing/src/main/java/org/apache/druid/segment/filter/Filters.java:195— Filters.checkFilterTuningUseIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OrFilter.makeFilterBundle (cognitive 24) processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:520— OrFilter.makeFilterBundle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3, boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LongValueSetIndexes.forSortedValues (cognitive 24) processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:304— LongValueSetIndexes.forSortedValues has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexIO.validateRowValues (cognitive 24) processing/src/main/java/org/apache/druid/segment/IndexIO.java:245— IndexIO.validateRowValues has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialQueryableIndex.<init> (cognitive 24) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:136— PartialQueryableIndex.<init> has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3 (5 pts), ternaries 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ExprEval.convertType (cognitive 24) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:237— ExprEval.convertType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloneHistoricals.run (cognitive 24) server/src/main/java/org/apache/druid/server/coordinator/duty/CloneHistoricals.java:76— CloneHistoricals.run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexerSQLMetadataStorageCoordinator.createNewPendingSegment (cognitive 24) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1529— IndexerSQLMetadataStorageCoordinator.createNewPendingSegment has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LDAPRoleProvider.getRoles (cognitive 24) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/LDAPRoleProvider.java:126— LDAPRoleProvider.getRoles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApproximateHistogram.fromBytesCompact (cognitive 24) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1361— ApproximateHistogram.fromBytesCompact has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (10 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClipOutlierHandler.simpleInterpolateMergeHandleOutliers (cognitive 24) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:1299— ClipOutlierHandler.simpleInterpolateMergeHandleOutliers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeRoleWatcher.keepWatching (cognitive 24) extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDruidNodeDiscoveryProvider.java:254— NodeRoleWatcher.keepWatching has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 3 (6 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CachingKubernetesPeonClient.waitForPeonJobCompletion (cognitive 24) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/CachingKubernetesPeonClient.java:68— CachingKubernetesPeonClient.waitForPeonJobCompletion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParquetGroupConverter.convertPrimitiveField (cognitive 24) extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupConverter.java:348— ParquetGroupConverter.convertPrimitiveField has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (7 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-format-step.InputFormatStep (cognitive 24) web-console/src/views/workbench-view/input-format-step/input-format-step.tsx:92— input-format-step.InputFormatStep has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, ternaries 8 (9 pts), if/else 3 (nesting depth added 1). Of this number, 20 points are the body's own statements and 4 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SeekableStreamSupervisor.discoverTasks (cognitive 23) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:2490— SeekableStreamSupervisor.discoverTasks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MSQWorkerTaskLauncher.updateTaskTrackersAndTaskIds (cognitive 23) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:588— MSQWorkerTaskLauncher.updateTaskTrackersAndTaskIds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupByPostShuffleFrameProcessor.runIncrementally (cognitive 23) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPostShuffleFrameProcessor.java:132— GroupByPostShuffleFrameProcessor.runIncrementally has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqlStatementResource.getResultSetInformation (cognitive 23) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:573— SqlStatementResource.getResultSetInformation has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 5 (9 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqlStatementResourceHelper.populatePagesForDurableStorageDestination (cognitive 23) multi-stage-query/src/main/java/org/apache/druid/msq/util/SqlStatementResourceHelper.java:206— SqlStatementResourceHelper.populatePagesForDurableStorageDestination has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionedIntervalTimeline.addAtKey (cognitive 23) processing/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java:627— VersionedIntervalTimeline.addAtKey has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionedIntervalTimeline.findChunk (cognitive 23) processing/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java:317— VersionedIntervalTimeline.findChunk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AggregatorFactory.mergeAggregators (cognitive 23) processing/src/main/java/org/apache/druid/query/aggregation/AggregatorFactory.java:414— AggregatorFactory.mergeAggregators has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 1 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1ParseJsonExpr.getArgAsObject (cognitive 23) processing/src/main/java/org/apache/druid/query/expression/NestedDataExpressions.java:199— 1ParseJsonExpr.getArgAsObject has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (9 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RowBasedKeySerdeFactory.compareDimsInRowsWithAggs (cognitive 23) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:1075— RowBasedKeySerdeFactory.compareDimsInRowsWithAggs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LazilyDecoratedRowsAndColumns.materializeCursorFactory (cognitive 23) processing/src/main/java/org/apache/druid/query/rowsandcols/LazilyDecoratedRowsAndColumns.java:205— LazilyDecoratedRowsAndColumns.materializeCursorFactory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchBinaryFn.apply (cognitive 23) processing/src/main/java/org/apache/druid/query/search/SearchBinaryFn.java:53— SearchBinaryFn.apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorCursorGranularizer.setCurrentOffsets (cognitive 23) processing/src/main/java/org/apache/druid/query/vector/VectorCursorGranularizer.java:135— VectorCursorGranularizer.setCurrentOffsets has cognitive complexity 23 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 5 (7 pts), boolean chains 4 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
IncrementalIndexRowComparator.compare (cognitive 23) processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java:1173— IncrementalIndexRowComparator.compare has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NestedDataColumnSupplierV4.read (cognitive 23) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplierV4.java:67— NestedDataColumnSupplierV4.read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NestedFieldColumnIndexSupplier.getLocalRangeFromDictionary (cognitive 23) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:231— NestedFieldColumnIndexSupplier.getLocalRangeFromDictionary has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 3 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DictionaryEncodedColumnMerger.writeMergedValueDictionary (cognitive 23) processing/src/main/java/org/apache/druid/segment/DictionaryEncodedColumnMerger.java:168— DictionaryEncodedColumnMerger.writeMergedValueDictionary has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexMergerBase.multiphaseMerge (cognitive 23) processing/src/main/java/org/apache/druid/segment/IndexMergerBase.java:234— IndexMergerBase.multiphaseMerge has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (7 pts), error handling 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnnestCursorFactory.transformCursorBuildSpec (cognitive 23) processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java:501— UnnestCursorFactory.transformCursorBuildSpec has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NettyHttpClient.go (cognitive 23) processing/src/main/java/org/apache/druid/java/util/http/client/NettyHttpClient.java:107— NettyHttpClient.go has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (3 pts), boolean chains 2, error handling 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SimdDoubleDoubleAddProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:45— SimdDoubleDoubleAddProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdDoubleDoubleDivProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:47— SimdDoubleDoubleDivProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdDoubleDoubleMulProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:45— SimdDoubleDoubleMulProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdDoubleDoubleSubProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:45— SimdDoubleDoubleSubProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdDoubleLongAddProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:46— SimdDoubleLongAddProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdDoubleLongDivProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java:46— SimdDoubleLongDivProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdDoubleLongMulProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongMulProcessor.java:46— SimdDoubleLongMulProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdDoubleLongSubProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongSubProcessor.java:46— SimdDoubleLongSubProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdLongDoubleAddProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:46— SimdLongDoubleAddProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdLongDoubleDivProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleDivProcessor.java:46— SimdLongDoubleDivProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdLongDoubleMulProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleMulProcessor.java:46— SimdLongDoubleMulProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdLongDoubleSubProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleSubProcessor.java:46— SimdLongDoubleSubProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdLongLongAddProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:45— SimdLongLongAddProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdLongLongMulProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java:45— SimdLongLongMulProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimdLongLongSubProcessor.processVector (cognitive 23) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongSubProcessor.java:45— SimdLongLongSubProcessor.processVector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageLocationVirtualStorageManager.reserveAndPopulate (cognitive 23) server/src/main/java/org/apache/druid/segment/loading/external/StorageLocationVirtualStorageManager.java:99— StorageLocationVirtualStorageManager.reserveAndPopulate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (10 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialSegmentMetadataCacheEntry.restoreBundlesFromDisk (cognitive 23) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:913— PartialSegmentMetadataCacheEntry.restoreBundlesFromDisk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 6 (9 pts), error handling 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoveRedundantIsTrue.apply0 (cognitive 23) sql/src/main/java/org/apache/druid/sql/calcite/filtration/RemoveRedundantIsTrue.java:56— RemoveRedundantIsTrue.apply0 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AggregatePullUpLookupRule.onMatch (cognitive 23) sql/src/main/java/org/apache/druid/sql/calcite/rule/AggregatePullUpLookupRule.java:57— AggregatePullUpLookupRule.onMatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrometheusEmitter.emitMetric (cognitive 23) extensions-contrib/prometheus-emitter/src/main/java/org/apache/druid/emitter/prometheus/PrometheusEmitter.java:146— PrometheusEmitter.emitMetric has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EC2NodeData.equals (cognitive 23) extensions-core/ec2-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2NodeData.java:135— EC2NodeData.equals has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 10, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartitionResource.fetchRecords (cognitive 23) extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:206— PartitionResource.fetchRecords has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (7 pts), error handling 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
supervisor-to-sql-dialog.SupervisorToSqlDialog (cognitive 23) web-console/src/dialogs/supervisor-to-sql-dialog/supervisor-to-sql-dialog.tsx:49— supervisor-to-sql-dialog.SupervisorToSqlDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 6, error handling 4, ternaries 1. Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (loadSupervisorSpec, parsePastedSupervisor, handleConvert, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
record-table-pane.RecordTablePane (cognitive 23) web-console/src/components/record-table-pane/record-table-pane.tsx:53— record-table-pane.RecordTablePane has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 7, if/else 3 (nesting depth added 6). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 138, getHeaderClassName, hasFilterOnHeader, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
segment-bar-chart.SegmentBarChart (cognitive 23) web-console/src/components/segment-timeline/segment-bar-chart.tsx:43— segment-bar-chart.SegmentBarChart has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, ternaries 3 (5 pts) (nesting depth added 5). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 53, 94, 129). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
filter-menu.FilterMenu (cognitive 23) web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:120— filter-menu.FilterMenu has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts), ternaries 4 (5 pts), error handling 1, match/switch 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 9 belong to 9 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rollup-analysis-pane.RollupAnalysisPane (cognitive 23) web-console/src/views/sql-data-loader-view/schema-step/rollup-analysis-pane/rollup-analysis-pane.tsx:144— rollup-analysis-pane.RollupAnalysisPane has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, boolean chains 10, ternaries 2. Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 154, a function literal at line 192, renderOverallResult, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CostBasedAutoScaler.extractAutoscalerMetric (cognitive 22) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:522— CostBasedAutoScaler.extractAutoscalerMetric has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (18 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LagBasedAutoScalerConfig.<init> (cognitive 22) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/LagBasedAutoScalerConfig.java:62— LagBasedAutoScalerConfig.<init> has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12, boolean chains 5, if/else 4 (5 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GroupByQueryKit.makeQueryDefinition (cognitive 22) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java:72— GroupByQueryKit.makeQueryDefinition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (9 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanQueryFrameProcessor.runWithInputChannel (cognitive 22) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryFrameProcessor.java:413— ScanQueryFrameProcessor.runWithInputChannel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NullableNumericTopNColumnAggregatesProcessor.scanAndAggregate (cognitive 22) processing/src/main/java/org/apache/druid/query/topn/types/NullableNumericTopNColumnAggregatesProcessor.java:86— NullableNumericTopNColumnAggregatesProcessor.scanAndAggregate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (10 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialSegmentFileMapperV10.planFetchRuns (cognitive 22) processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:780— PartialSegmentFileMapperV10.planFetchRuns has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColumnValueGenerator.initDistribution (cognitive 22) processing/src/main/java/org/apache/druid/segment/generator/ColumnValueGenerator.java:142— ColumnValueGenerator.initDistribution has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 6 (8 pts), match/switch 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Projections.findMatchingProjection (cognitive 22) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:135— Projections.findMatchingProjection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilteredVectorOffset.advanceWhileVectorIsEmptyAndPopulateOffsets (cognitive 22) processing/src/main/java/org/apache/druid/segment/vector/FilteredVectorOffset.java:116— FilteredVectorOffset.advanceWhileVectorIsEmptyAndPopulateOffsets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NestedFieldVirtualColumn.makeColumnValueSelector (cognitive 22) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:373— NestedFieldVirtualColumn.makeColumnValueSelector has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryableIndexCursorHolder.asCursor (cognitive 22) processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorHolder.java:204— QueryableIndexCursorHolder.asCursor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnnestCursorFactory.recursiveRewriteOnUnnestFilters (cognitive 22) processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java:355— UnnestCursorFactory.recursiveRewriteOnUnnestFilters has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImmutableConciseSet.complement (cognitive 22) processing/src/main/java/org/apache/druid/extendedset/intset/ImmutableConciseSet.java:182— ImmutableConciseSet.complement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringFrameColumn.getRowAsObject (cognitive 22) processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:565— StringFrameColumn.getRowAsObject has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (9 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringFrameColumnWriter.addSelection (cognitive 22) processing/src/main/java/org/apache/druid/frame/write/columnar/StringFrameColumnWriter.java:99— StringFrameColumnWriter.addSelection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 3, boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CompactSegments.createCompactionTask (cognitive 22) server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java:302— CompactSegments.createCompactionTask has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, error handling 1 (3 pts), ternaries 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TLSUtils.createSSLContext (cognitive 22) server/src/main/java/org/apache/druid/server/security/TLSUtils.java:166— TLSUtils.createSSLContext has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 4 (5 pts), error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentLocalCacheManager.assignLocationAndMount (cognitive 22) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:2098— SegmentLocalCacheManager.assignLocationAndMount has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentLocalCacheManager.getCachedSegments (cognitive 22) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:204— SegmentLocalCacheManager.getCachedSegments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 3 (7 pts), loops 3 (6 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataSchema.computeAndValidateOutputFieldNames (cognitive 22) server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java:486— DataSchema.computeAndValidateOutputFieldNames has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidSqlParserUtils.convertSqlNodeToGranularity (cognitive 22) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParserUtils.java:113— DruidSqlParserUtils.convertSqlNodeToGranularity has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (19 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DruidQuery.toTimeBoundaryQuery (cognitive 22) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1074— DruidQuery.toTimeBoundaryQuery has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Windowing.fromCalciteStuff (cognitive 22) sql/src/main/java/org/apache/druid/sql/calcite/rel/Windowing.java:117— Windowing.fromCalciteStuff has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AggregateMergeRule.pushProjectThroughAggregate (cognitive 22) sql/src/main/java/org/apache/druid/sql/calcite/rule/AggregateMergeRule.java:183— AggregateMergeRule.pushProjectThroughAggregate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThetaSketchBaseSqlAggregator.toDruidAggregation (cognitive 22) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchBaseSqlAggregator.java:62— ThetaSketchBaseSqlAggregator.toDruidAggregation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrayOfDoublesSketchBuildAggregator.aggregate (cognitive 22) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildAggregator.java:81— ArrayOfDoublesSketchBuildAggregator.aggregate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrayOfDoublesSketchBuildBufferAggregator.aggregate (cognitive 22) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchBuildBufferAggregator.java:91— ArrayOfDoublesSketchBuildBufferAggregator.aggregate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.getToken (cognitive 22) extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/KerberosAuthenticator.java:183— 1.getToken has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HdfsInputSource.getPaths (cognitive 22) extensions-core/hdfs-storage/src/main/java/org/apache/druid/inputsource/hdfs/HdfsInputSource.java:152— HdfsInputSource.getPaths has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FixedBucketsHistogram.simpleInterpolateMerge (cognitive 22) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java:627— FixedBucketsHistogram.simpleInterpolateMerge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultipleKubernetesTaskRunnerConfig.fromProperties (cognitive 22) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/MultipleKubernetesTaskRunnerConfig.java:229— MultipleKubernetesTaskRunnerConfig.fromProperties has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (9 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Capabilities.getModeExtended (cognitive 22) web-console/src/helpers/capabilities.ts:317— Capabilities.getModeExtended has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
execution-stages-pane.ExecutionStagesPane::detailedCountersForWorkers (cognitive 22) web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx:223— execution-stages-pane.ExecutionStagesPane::detailedCountersForWorkers has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 8, ternaries 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (execution-stages-pane.ExecutionStagesPane) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
input-source.issueWithInputSource (cognitive 22) web-console/src/druid-models/input-source/input-source.tsx:142— input-source.issueWithInputSource has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
column-editor.ColumnEditor (cognitive 22) web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx:129— column-editor.ColumnEditor has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 13, if/else 3 (6 pts), ternaries 2, error handling 1 (nesting depth added 3). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ControllerImpl.publishAllSegments (cognitive 21) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1566— ControllerImpl.publishAllSegments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (6 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryKitBasedMSQPlanner.makeQueryDefinitionInternal (cognitive 21) multi-stage-query/src/main/java/org/apache/druid/msq/exec/QueryKitBasedMSQPlanner.java:124— QueryKitBasedMSQPlanner.makeQueryDefinitionInternal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), error handling 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MSQCompactionRunner.runSubtasks (cognitive 21) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQCompactionRunner.java:808— MSQCompactionRunner.runSubtasks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashVectorGrouper.aggregateVector (cognitive 21) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/HashVectorGrouper.java:122— HashVectorGrouper.aggregateVector has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RowBasedGrouperHelper.makeGrouperIterator (cognitive 21) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:591— RowBasedGrouperHelper.makeGrouperIterator has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RowBasedKeySerdeFactory.objectComparatorWithAggs (cognitive 21) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:923— RowBasedKeySerdeFactory.objectComparatorWithAggs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingMergeSortedGrouper.increaseWriteIndex (cognitive 21) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouper.java:282— StreamingMergeSortedGrouper.increaseWriteIndex has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlphanumericComparator.compare (cognitive 21) processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:117— AlphanumericComparator.compare has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.findRow (cognitive 21) processing/src/main/java/org/apache/druid/query/rowsandcols/semantic/DefaultSortedMatrixMaker.java:140— 1.findRow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Queries.computeRequiredColumns (cognitive 21) processing/src/main/java/org/apache/druid/query/Queries.java:254— Queries.computeRequiredColumns has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 6 (9 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpatialDimensionRowTransformer.apply (cognitive 21) processing/src/main/java/org/apache/druid/segment/incremental/SpatialDimensionRowTransformer.java:82— SpatialDimensionRowTransformer.apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JoinFilterCorrelations.computeJoinFilterCorrelations (cognitive 21) processing/src/main/java/org/apache/druid/segment/join/filter/JoinFilterCorrelations.java:71— JoinFilterCorrelations.computeJoinFilterCorrelations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexedTableJoinable.getCorrelatedColumnValues (cognitive 21) processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinable.java:127— IndexedTableJoinable.getCorrelatedColumnValues has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StructuredDataBuilder.buildObject (cognitive 21) processing/src/main/java/org/apache/druid/segment/nested/StructuredDataBuilder.java:66— StructuredDataBuilder.buildObject has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Projections.matchFilter (cognitive 21) processing/src/main/java/org/apache/druid/segment/projections/Projections.java:290— Projections.matchFilter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSet.appendFill (cognitive 21) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:543— ConciseSet.appendFill has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RowBasedFrameWriter.writeDataUsingFieldWriters (cognitive 21) processing/src/main/java/org/apache/druid/frame/write/RowBasedFrameWriter.java:271— RowBasedFrameWriter.writeDataUsingFieldWriters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 3 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GranularityType.fromPeriod (cognitive 21) processing/src/main/java/org/apache/druid/java/util/common/granularity/GranularityType.java:192— GranularityType.fromPeriod has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrayExprEval.castTo (cognitive 21) processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:1295— ArrayExprEval.castTo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (6 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StrategicSegmentAssigner.broadcastSegment (cognitive 21) server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:862— StrategicSegmentAssigner.broadcastSegment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (9 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StrategicSegmentAssigner.updateReplicasInTierPartial (cognitive 21) server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:389— StrategicSegmentAssigner.updateReplicasInTierPartial has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientInfoResource.getDatasource (cognitive 21) server/src/main/java/org/apache/druid/server/ClientInfoResource.java:139— ClientInfoResource.getDatasource has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentLocalCacheManager.addFilesToCachedSegments (cognitive 21) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:287— SegmentLocalCacheManager.addFilesToCachedSegments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoordinatorSegmentMetadataCache.mergeOrCreateRowSignature (cognitive 21) server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:802— CoordinatorSegmentMetadataCache.mergeOrCreateRowSignature has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsyncQueryForwardingServlet.getAvaticaProtobufConnectionId (cognitive 21) services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java:715— AsyncQueryForwardingServlet.getAvaticaProtobufConnectionId has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScalarInArrayOperatorConversion.toDruidFilter (cognitive 21) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ScalarInArrayOperatorConversion.java:75— ScalarInArrayOperatorConversion.toDruidFilter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expressions.toFilter (cognitive 21) sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java:407— Expressions.toFilter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectionSpecTranslator.liftRollupBaseTable (cognitive 21) sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java:317— ProjectionSpecTranslator.liftRollupBaseTable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AggregateMergeRule.apply (cognitive 21) sql/src/main/java/org/apache/druid/sql/calcite/rule/AggregateMergeRule.java:71— AggregateMergeRule.apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilterDecomposeConcatRule.tryDecomposeConcatEquals (cognitive 21) sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRule.java:154— FilterDecomposeConcatRule.tryDecomposeConcatEquals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqlParameter.getTypedValue (cognitive 21) sql/src/main/java/org/apache/druid/sql/http/SqlParameter.java:74— SqlParameter.getTypedValue has cognitive complexity 21 (threshold 15). Drivers by points: error handling 3 (11 pts), if/else 6 (10 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AWSClientUtil.isClientExceptionRecoverable (cognitive 21) cloud/aws-common/src/main/java/org/apache/druid/common/aws/AWSClientUtil.java:74— AWSClientUtil.isClientExceptionRecoverable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmbariMetricsEmitterConfig.equals (cognitive 21) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitterConfig.java:191— AmbariMetricsEmitterConfig.equals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, ternaries 3 (6 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GraphiteEmitter.emit (cognitive 21) extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitter.java:100— GraphiteEmitter.emit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compaction-status.formatCompactionInfo (cognitive 21) web-console/src/druid-models/compaction-status/compaction-status.ts:61— compaction-status.formatCompactionInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LoadDataView.renderParserStep (cognitive 21) web-console/src/views/load-data-view/load-data-view.tsx:1535— LoadDataView.renderParserStep has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, if/else 4, ternaries 3. Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TasksView.renderTaskTable (cognitive 21) web-console/src/views/tasks-view/tasks-view.tsx:374— TasksView.renderTaskTable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 4, match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 448, 472, 495, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SeekableStreamSupervisor.checkpointTaskGroup (cognitive 20) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4097— SeekableStreamSupervisor.checkpointTaskGroup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TaskLockbox.resetState (cognitive 20) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:162— TaskLockbox.resetState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentAllocateAction.perform (cognitive 20) indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentAllocateAction.java:208— SegmentAllocateAction.perform has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 1 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractBatchIndexTask.findIntervalAndVersion (cognitive 20) indexing-service/src/main/java/org/apache/druid/indexing/common/task/AbstractBatchIndexTask.java:794— AbstractBatchIndexTask.findIntervalAndVersion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkerTaskManager.doCompletedTasksCleanup (cognitive 20) indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java:622— WorkerTaskManager.doCompletedTasksCleanup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MSQCompactionRunner.getAggregateDimensions (cognitive 20) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQCompactionRunner.java:428— MSQCompactionRunner.getAggregateDimensions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortMergeJoinFrameProcessor.nextAwait (cognitive 20) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessor.java:386— SortMergeJoinFrameProcessor.nextAwait has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DimensionSchemaUtils.createDimensionSchema (cognitive 20) multi-stage-query/src/main/java/org/apache/druid/msq/util/DimensionSchemaUtils.java:72— DimensionSchemaUtils.createDimensionSchema has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlatTextInputFormat.<init> (cognitive 20) processing/src/main/java/org/apache/druid/data/input/impl/FlatTextInputFormat.java:51— FlatTextInputFormat.<init> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConcurrentGrouper.iterator (cognitive 20) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ConcurrentGrouper.java:345— ConcurrentGrouper.iterator has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentAnalyzer.analyzeStringColumn (cognitive 20) processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java:264— SegmentAnalyzer.analyzeStringColumn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (7 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JoinLogic.go (cognitive 20) processing/src/main/java/org/apache/druid/query/operator/join/SortedInnerJoinOperator.java:130— JoinLogic.go has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimeFilterExplorer.visit (cognitive 20) processing/src/main/java/org/apache/druid/query/planning/RequireTimeConditionAnalyzer.java:166— TimeFilterExplorer.visit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontCodedV0.findInBucket (cognitive 20) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:528— FrontCodedV0.findInBucket has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontCodedIndexedWriter.writeBucketV0 (cognitive 20) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:291— FrontCodedIndexedWriter.writeBucketV0 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (FrontCodedIndexedWriter.writeBucketV1) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FrontCodedIndexedWriter.writeBucketV1 (cognitive 20) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:341— FrontCodedIndexedWriter.writeBucketV1 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (FrontCodedIndexedWriter.writeBucketV0) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FrontCodedIntArrayIndexed.getFromBucket (cognitive 20) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:463— FrontCodedIntArrayIndexed.getFromBucket has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 5 (9 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FrontCodedIntArrayIndexedWriter.getFromBucket (cognitive 20) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:374— FrontCodedIntArrayIndexedWriter.getFromBucket has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 5 (9 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FrontCodedIntArrayIndexedWriter.writeBucket (cognitive 20) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:303— FrontCodedIntArrayIndexedWriter.writeBucket has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DimensionHandlerUtils.convertObjectToLong (cognitive 20) processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:373— DimensionHandlerUtils.convertObjectToLong has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleQueryableIndex.<init> (cognitive 20) processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java:130— SimpleQueryableIndex.<init> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (5 pts), boolean chains 3, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SuperSorter.runMerger (cognitive 20) processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java:710— SuperSorter.runMerger has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 2 (3 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrameWriterUtils.copyByteBufferToMemory (cognitive 20) processing/src/main/java/org/apache/druid/frame/write/FrameWriterUtils.java:243— FrameWriterUtils.copyByteBufferToMemory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser.flatten (cognitive 20) processing/src/main/java/org/apache/druid/math/expr/Parser.java:166— Parser.flatten has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (20 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryResultPusher.handleDruidException (cognitive 20) server/src/main/java/org/apache/druid/server/QueryResultPusher.java:265— QueryResultPusher.handleDruidException has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (6 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpecificQueryRunnable.computeUncoveredIntervals (cognitive 20) server/src/main/java/org/apache/druid/client/CachingClusteredClient.java:488— SpecificQueryRunnable.computeUncoveredIntervals has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalDataSegmentPuller.getSegmentFiles (cognitive 20) server/src/main/java/org/apache/druid/segment/loading/LocalDataSegmentPuller.java:119— LocalDataSegmentPuller.getSegmentFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialSegmentMetadataCacheEntry.doMount (cognitive 20) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:753— PartialSegmentMetadataCacheEntry.doMount has cognitive complexity 20 (threshold 15). Drivers by points: error handling 7 (11 pts), if/else 4 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompleteSegmentCacheEntry.mount (cognitive 20) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:2299— CompleteSegmentCacheEntry.mount has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CoordinatorSegmentMetadataCache.refreshColdSegmentSchemas (cognitive 20) server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:582— CoordinatorSegmentMetadataCache.refreshColdSegmentSchemas has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchAppenderator.add (cognitive 20) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:258— BatchAppenderator.add has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamAppenderator.mergeAndPush (cognitive 20) server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:883— StreamAppenderator.mergeAndPush has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (6 pts), error handling 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathChildrenAnnouncer.announce (cognitive 20) server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java:228— PathChildrenAnnouncer.announce has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConvertSelectorsToIns.splitAnd (cognitive 20) sql/src/main/java/org/apache/druid/sql/calcite/filtration/ConvertSelectorsToIns.java:89— ConvertSelectorsToIns.splitAnd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateTableHandler.validateStatement (cognitive 20) sql/src/main/java/org/apache/druid/sql/calcite/planner/CatalogDdlHandler.java:366— CreateTableHandler.validateStatement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidQuery.toScanQuery (cognitive 20) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1661— DruidQuery.toScanQuery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidJoinRule.onMatch (cognitive 20) sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidJoinRule.java:113— DruidJoinRule.onMatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6, loops 3 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DecomposeConcatShuttle.visitCall (cognitive 20) sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRule.java:89— DecomposeConcatShuttle.visitCall has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
InlineValuesRexShuttle.tryInlineIn (cognitive 20) sql/src/main/java/org/apache/druid/sql/calcite/rule/InlineValuesSubQueryRule.java:153— InlineValuesRexShuttle.tryInlineIn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqlQuery.from (cognitive 20) sql/src/main/java/org/apache/druid/sql/http/SqlQuery.java:257— SqlQuery.from has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 5 (6 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InfluxdbEmitterConfig.equals (cognitive 20) extensions-contrib/influxdb-emitter/src/main/java/org/apache/druid/emitter/influxdb/InfluxdbEmitterConfig.java:103— InfluxdbEmitterConfig.equals has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, ternaries 2 (4 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TsFileInputEntityReader.selectColumns (cognitive 20) extensions-contrib/tsfile-extensions/src/main/java/org/apache/druid/data/input/tsfile/TsFileInputEntityReader.java:196— TsFileInputEntityReader.selectColumns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApproximateHistogram.getQuantiles (cognitive 20) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1527— ApproximateHistogram.getQuantiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
table-query.makeTableQueryAndHints (cognitive 20) web-console/src/views/explore-view/utils/table-query.ts:378— table-query.makeTableQueryAndHints has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), ternaries 2 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuerySource.restrictParameterValue (cognitive 20) web-console/src/views/explore-view/models/query-source.ts:344— QuerySource.restrictParameterValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskLockbox.getActiveLocks (cognitive 19) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:1026— TaskLockbox.getActiveLocks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ParallelIndexSupervisorTask.runHashPartitionMultiPhaseParallel (cognitive 19) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:734— ParallelIndexSupervisorTask.runHashPartitionMultiPhaseParallel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskMonitor.start (cognitive 19) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TaskMonitor.java:122— TaskMonitor.start has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionTask.<init> (cognitive 19) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:192— CompactionTask.<init> has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IndexTask.createShardSpecsFromInput (cognitive 19) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:658— IndexTask.createShardSpecsFromInput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (8 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexTuningConfig.getPartitionsSpec (cognitive 19) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:1229— IndexTuningConfig.getPartitionsSpec has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidPreparedStatement.setObject (cognitive 19) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidPreparedStatement.java:346— DruidPreparedStatement.setObject has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ControllerStageTracker.mergeClusterByStatisticsCollectorForAllTimeChunks (cognitive 19) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:674— ControllerStageTracker.mergeClusterByStatisticsCollectorForAllTimeChunks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SortMergeJoinFrameProcessor.runIncrementally (cognitive 19) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessor.java:171— SortMergeJoinFrameProcessor.runIncrementally has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqlStatementResource.getResultYielder (cognitive 19) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:767— SqlStatementResource.getResultYielder has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionedIntervalTimeline.lookup (cognitive 19) processing/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java:792— VersionedIntervalTimeline.lookup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FilteredAggregatorFactory.optimizeForSegment (cognitive 19) processing/src/main/java/org/apache/druid/query/aggregation/FilteredAggregatorFactory.java:223— FilteredAggregatorFactory.optimizeForSegment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TrimStaticCharsExpr.eval (cognitive 19) processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:124— TrimStaticCharsExpr.eval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TrimDynamicCharsExpr.eval (cognitive 19) processing/src/main/java/org/apache/druid/query/expression/TrimExprMacro.java:192— TrimDynamicCharsExpr.eval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrouperBufferComparatorUtils.bufferComparatorWithAggregators (cognitive 19) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:122— GrouperBufferComparatorUtils.bufferComparatorWithAggregators has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupByQuery.verifySubtotalsSpec (cognitive 19) processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:269— GroupByQuery.verifySubtotalsSpec has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupByQueryQueryToolChest.mergeGroupByResultsWithoutPushDown (cognitive 19) processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java:246— GroupByQueryQueryToolChest.mergeGroupByResultsWithoutPushDown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
23225.apply (cognitive 19) processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java:662— 23225.apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimeseriesQueryEngine.processNonVectorized (cognitive 19) processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryEngine.java:248— TimeseriesQueryEngine.processNonVectorized has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HiveCnfHelper.pushDownNot (cognitive 19) processing/src/main/java/org/apache/druid/segment/filter/cnf/HiveCnfHelper.java:43— HiveCnfHelper.pushDownNot has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 6 (9 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
AndFilter.makeFilterBundle (cognitive 19) processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:207— AndFilter.makeFilterBundle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.matches (cognitive 19) processing/src/main/java/org/apache/druid/segment/filter/ExpressionFilter.java:144— 1.matches has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JoinFilterAnalyzer.rewriteSelectorFilter (cognitive 19) processing/src/main/java/org/apache/druid/segment/join/filter/JoinFilterAnalyzer.java:424— JoinFilterAnalyzer.rewriteSelectorFilter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringUtf8ColumnIndexSupplier.as (cognitive 19) processing/src/main/java/org/apache/druid/segment/serde/StringUtf8ColumnIndexSupplier.java:77— StringUtf8ColumnIndexSupplier.as has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Transformer.transform (cognitive 19) processing/src/main/java/org/apache/druid/segment/transform/Transformer.java:118— Transformer.transform has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (5 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorSelectorUtils.populateNullVector (cognitive 19) processing/src/main/java/org/apache/druid/segment/vector/VectorSelectorUtils.java:33— VectorSelectorUtils.populateNullVector has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DimensionHandlerUtils.convertObjectToDouble (cognitive 19) processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:699— DimensionHandlerUtils.convertObjectToDouble has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DimensionHandlerUtils.convertObjectToFloat) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DimensionHandlerUtils.convertObjectToFloat (cognitive 19) processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:487— DimensionHandlerUtils.convertObjectToFloat has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DimensionHandlerUtils.convertObjectToDouble) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MergingRowIterator.moveToNext (cognitive 19) processing/src/main/java/org/apache/druid/segment/MergingRowIterator.java:112— MergingRowIterator.moveToNext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryableIndexCursorHolder.asVectorCursor (cognitive 19) processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorHolder.java:289— QueryableIndexCursorHolder.asVectorCursor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, ternaries 3 (5 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UnnestCursorFactory.computeBaseAndPostUnnestFilters (cognitive 19) processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java:245— UnnestCursorFactory.computeBaseAndPostUnnestFilters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GutmanSplitStrategy.split (cognitive 19) processing/src/main/java/org/apache/druid/collections/spatial/split/GutmanSplitStrategy.java:67— GutmanSplitStrategy.split has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringFieldReader.addStringsToList (cognitive 19) processing/src/main/java/org/apache/druid/frame/field/StringFieldReader.java:545— StringFieldReader.addStringsToList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimestampParser.createTimestampParser (cognitive 19) processing/src/main/java/org/apache/druid/java/util/common/parsers/TimestampParser.java:39— TimestampParser.createTimestampParser has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResourceHolderPerKey.get (cognitive 19) processing/src/main/java/org/apache/druid/java/util/http/client/pool/ResourcePool.java:481— ResourceHolderPerKey.get has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoalesceDoubleVectorProcessor.evalVector (cognitive 19) processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceDoubleVectorProcessor.java:41— CoalesceDoubleVectorProcessor.evalVector has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoalesceLongVectorProcessor.evalVector (cognitive 19) processing/src/main/java/org/apache/druid/math/expr/vector/CoalesceLongVectorProcessor.java:41— CoalesceLongVectorProcessor.evalVector has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConnectionUriUtils.getPropertiesFromHosts (cognitive 19) processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:215— ConnectionUriUtils.getPropertiesFromHosts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KillUnusedSegments.killUnusedSegments (cognitive 19) server/src/main/java/org/apache/druid/server/coordinator/duty/KillUnusedSegments.java:192— KillUnusedSegments.killUnusedSegments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
17202.onSuccess (cognitive 19) server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java:412— 17202.onSuccess has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (3 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LoggingRequestLogger.logNativeQuery (cognitive 19) server/src/main/java/org/apache/druid/server/log/LoggingRequestLogger.java:55— LoggingRequestLogger.logNativeQuery has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (7 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentManager.loadSegmentInternal (cognitive 19) server/src/main/java/org/apache/druid/server/SegmentManager.java:353— SegmentManager.loadSegmentInternal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchAppenderator.mergeAndPush (cognitive 19) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:754— BatchAppenderator.mergeAndPush has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4 (5 pts), loops 3, error handling 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SinkQuerySegmentWalker.getQueryRunnerForSegments (cognitive 19) server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java:173— SinkQuerySegmentWalker.getQueryRunnerForSegments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PullDependencies.downloadExtension (cognitive 19) services/src/main/java/org/apache/druid/cli/PullDependencies.java:332— PullDependencies.downloadExtension has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3, error handling 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchOperatorConversion.makeIn (cognitive 19) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/SearchOperatorConversion.java:239— SearchOperatorConversion.makeIn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 2 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompressedBigDecimal.directCompareCompressedBigDecimal (cognitive 19) extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimal.java:400— CompressedBigDecimal.directCompareCompressedBigDecimal has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultConsulApiClient.parseHealthServices (cognitive 19) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/DefaultConsulApiClient.java:236— DefaultConsulApiClient.parseHealthServices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeltaInputRow.getValue (cognitive 19) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/DeltaInputRow.java:172— DeltaInputRow.getValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RowSerde.convertRowToJsonObject (cognitive 19) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/input/RowSerde.java:102— RowSerde.convertRowToJsonObject has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (18 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
OpaAuthorizer.sanitizeSearchResult (cognitive 19) extensions-contrib/druid-opa-authorizer/src/main/java/org/apache/druid/security/opa/OpaAuthorizer.java:210— OpaAuthorizer.sanitizeSearchResult has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AvroFlattenerMaker.transformValue (cognitive 19) extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroFlattenerMaker.java:186— AvroFlattenerMaker.transformValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SketchAggregator.updateUnion (cognitive 19) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregator.java:134— SketchAggregator.updateUnion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HdfsDataSegmentKiller.kill (cognitive 19) extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java:81— HdfsDataSegmentKiller.kill has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, ternaries 3 (4 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
KinesisIndexTaskRunner.possiblyResetDataSourceMetadata (cognitive 19) extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskRunner.java:113— KinesisIndexTaskRunner.possiblyResetDataSourceMetadata has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 pts), error handling 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultipleKubernetesTaskRunnerFactory.build (cognitive 19) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/MultipleKubernetesTaskRunnerFactory.java:113— MultipleKubernetesTaskRunnerFactory.build has cognitive complexity 19 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 3 (6 pts), ternaries 3 (4 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgreSQLConnector.<init> (cognitive 19) extensions-core/postgresql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/postgresql/PostgreSQLConnector.java:66— PostgreSQLConnector.<init> has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (19 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
values-query.queryResultToValuesQuery (cognitive 19) web-console/src/utils/values-query.tsx:61— values-query.queryResultToValuesQuery has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 2). None of this is in the body itself: all 19 points belong to 2 function literals inside it that branch (lines 100, 68). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
table-query.makeJoinCompareTableQueryAndHints (cognitive 19) web-console/src/views/explore-view/utils/table-query.ts:557— table-query.makeJoinCompareTableQueryAndHints has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 4, if/else 3 (4 pts), loops 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
services-card.ServicesCard (cognitive 19) web-console/src/views/home-view/services-card/services-card.tsx:44— services-card.ServicesCard has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 8, if/else 3. Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 46). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
explain-dialog.ExplainDialog (cognitive 19) web-console/src/views/workbench-view/explain-dialog/explain-dialog.tsx:65— explain-dialog.ExplainDialog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, error handling 2 (3 pts), match/switch 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 70, renderQueryExplanation). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SeekableStreamSupervisor.hasTaskGroupReachedBoundedEnd (cognitive 18) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:4903— SeekableStreamSupervisor.hasTaskGroupReachedBoundedEnd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParallelIndexTuningConfig.<init> (cognitive 18) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexTuningConfig.java:116— ParallelIndexTuningConfig.<init> has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CascadingReindexingTemplate.createCompactionJobs (cognitive 18) indexing-service/src/main/java/org/apache/druid/indexing/compact/CascadingReindexingTemplate.java:328— CascadingReindexingTemplate.createCompactionJobs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DurableStorageCleaner.run (cognitive 18) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/cleaner/DurableStorageCleaner.java:81— DurableStorageCleaner.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupByPreShuffleFrameProcessor.runWithDataServerQuery (cognitive 18) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPreShuffleFrameProcessor.java:143— GroupByPreShuffleFrameProcessor.runWithDataServerQuery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqlStatementResourceHelper.populatePageList (cognitive 18) multi-stage-query/src/main/java/org/apache/druid/msq/util/SqlStatementResourceHelper.java:162— SqlStatementResourceHelper.populatePageList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataSegment.retainOnlyDetails (cognitive 18) processing/src/main/java/org/apache/druid/timeline/DataSegment.java:535— DataSegment.retainOnlyDetails has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionedIntervalTimeline.addAll (cognitive 18) processing/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java:216— VersionedIntervalTimeline.addAll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HttpEntity.openInputStream (cognitive 18) processing/src/main/java/org/apache/druid/data/input/impl/HttpEntity.java:88— HttpEntity.openInputStream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StringCardinalityAggregatorColumnSelectorStrategy.hashRow (cognitive 18) processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/StringCardinalityAggregatorColumnSelectorStrategy.java:45— StringCardinalityAggregatorColumnSelectorStrategy.hashRow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorMatch.isValid (cognitive 18) processing/src/main/java/org/apache/druid/query/filter/vector/VectorMatch.java:101— VectorMatch.isValid has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeFilter.makeLongPredicateSupplier (cognitive 18) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:502— RangeFilter.makeLongPredicateSupplier has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RowBasedGrouperHelper.createGrouperAccumulatorPair (cognitive 18) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java:190— RowBasedGrouperHelper.createGrouperAccumulatorPair has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, ternaries 4, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GroupByQuery.getOrderingAndDimensions (cognitive 18) processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:611— GroupByQuery.getOrderingAndDimensions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanQuery.<init> (cognitive 18) processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java:125— ScanQuery.<init> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3, loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimeseriesQueryEngine.processVectorized (cognitive 18) processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryEngine.java:131— TimeseriesQueryEngine.processVectorized has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontCodedIndexedWriter.write (cognitive 18) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:106— FrontCodedIndexedWriter.write has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialSegmentFileMapperV10.createForFile (cognitive 18) processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:191— PartialSegmentFileMapperV10.createForFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3 (5 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnheapIncrementalIndex.initAggs (cognitive 18) processing/src/main/java/org/apache/druid/segment/incremental/OnheapIncrementalIndex.java:240— OnheapIncrementalIndex.initAggs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NestedDataColumnSerializer.writeTo (cognitive 18) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java:386— NestedDataColumnSerializer.writeTo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AggregateProjectionSchema.<init> (cognitive 18) processing/src/main/java/org/apache/druid/segment/projections/AggregateProjectionSchema.java:105— AggregateProjectionSchema.<init> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4, boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NestedFieldVirtualColumn.capabilities (cognitive 18) processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:761— NestedFieldVirtualColumn.capabilities has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSet.appendLiteral (cognitive 18) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:492— ConciseSet.appendLiteral has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SuperSorter.getTotalMergersInLevel (cognitive 18) processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java:934— SuperSorter.getTotalMergersInLevel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HyperLogLogCollector.fold (cognitive 18) processing/src/main/java/org/apache/druid/hll/HyperLogLogCollector.java:385— HyperLogLogCollector.fold has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
JSONToLowerParser.parseToMap (cognitive 18) processing/src/main/java/org/apache/druid/java/util/common/parsers/JSONToLowerParser.java:111— JSONToLowerParser.parseToMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), error handling 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlattenerMaker.toPlainJavaType (cognitive 18) processing/src/main/java/org/apache/druid/java/util/common/parsers/ObjectFlatteners.java:268— FlattenerMaker.toPlainJavaType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelResourceFactory.generate (cognitive 18) processing/src/main/java/org/apache/druid/java/util/http/client/pool/ChannelResourceFactory.java:88— ChannelResourceFactory.generate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StrategicSegmentAssigner.updateReplicasInTier (cognitive 18) server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:696— StrategicSegmentAssigner.updateReplicasInTier has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
WeightedQueryLaningStrategy.<init> (cognitive 18) server/src/main/java/org/apache/druid/server/scheduling/WeightedQueryLaningStrategy.java:111— WeightedQueryLaningStrategy.<init> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, error handling 3 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SpecificQueryRunnable.computeSegmentsToQuery (cognitive 18) server/src/main/java/org/apache/druid/client/CachingClusteredClient.java:431— SpecificQueryRunnable.computeSegmentsToQuery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), match/switch 1 (3 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HeapMemorySegmentMetadataCache.markCacheSynced (cognitive 18) server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java:625— HeapMemorySegmentMetadataCache.markCacheSynced has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexerSQLMetadataStorageCoordinator.createNewSegments (cognitive 18) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1322— IndexerSQLMetadataStorageCoordinator.createNewSegments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexerSQLMetadataStorageCoordinator.updateDataSourceMetadataInTransaction (cognitive 18) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:2347— IndexerSQLMetadataStorageCoordinator.updateDataSourceMetadataInTransaction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DownloadableCacheEntry.mount (cognitive 18) server/src/main/java/org/apache/druid/segment/loading/external/DownloadableCacheEntry.java:94— DownloadableCacheEntry.mount has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractSegmentMetadataCache.cacheExecLoop (cognitive 18) server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:255— AbstractSegmentMetadataCache.cacheExecLoop has cognitive complexity 18 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 2 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentSchemaManager.persistSegmentSchema (cognitive 18) server/src/main/java/org/apache/druid/segment/metadata/SegmentSchemaManager.java:177— SegmentSchemaManager.persistSegmentSchema has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.after (cognitive 18) server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java:549— 1.after has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (6 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeAnnouncer.announce (cognitive 18) server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java:238— NodeAnnouncer.announce has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubstringOperatorConversion.toDruidExpression (cognitive 18) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/SubstringOperatorConversion.java:60— SubstringOperatorConversion.toDruidExpression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DruidSqlParser.processStatementList (cognitive 18) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParser.java:98— DruidSqlParser.processStatementList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidQuery.fromPartialQuery (cognitive 18) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:199— DruidQuery.fromPartialQuery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CaseToCoalesceShuttle.visitCall (cognitive 18) sql/src/main/java/org/apache/druid/sql/calcite/rule/CaseToCoalesceRule.java:82— CaseToCoalesceShuttle.visitCall has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilterJoinExcludePushToChildRule.perform (cognitive 18) sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRule.java:96— FilterJoinExcludePushToChildRule.perform has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ArrayOfDoublesSketchSqlAggregator.toDruidAggregation (cognitive 18) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/sql/ArrayOfDoublesSketchSqlAggregator.java:68— ArrayOfDoublesSketchSqlAggregator.toDruidAggregation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
3602.apply (cognitive 18) extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3Utils.java:87— 3602.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
console-table.ConsoleTable (cognitive 18) web-console/src/components/console-table/console-table.tsx:347— console-table.ConsoleTable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 29, ternaries 14 (16 pts) (nesting depth added 12). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (console-table.ConsoleTable::sortColumn) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
diff-dialog.DiffDialog (cognitive 18) web-console/src/dialogs/diff-dialog/diff-dialog.tsx:59— diff-dialog.DiffDialog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidError.getSuggestion (cognitive 18) REDACTED:143— DruidError.getSuggestion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 pts) (nesting depth added 6). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 154, 170, 193, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
header-bar.HeaderBar (cognitive 18) web-console/src/components/header-bar/header-bar.tsx:72— header-bar.HeaderBar has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, ternaries 3, if/else 2. Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
graph-info.computeNextInfo (cognitive 18) web-console/src/druid-models/stages/graph-info.ts:29— graph-info.computeNextInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (5 pts), loops 1 (nesting depth added 8). Of this number, 13 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
time-manipulation.overqueryWhere (cognitive 18) web-console/src/views/explore-view/utils/time-manipulation.ts:200— time-manipulation.overqueryWhere has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3 (nesting depth added 9). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 207). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
expression-menu.ExpressionMenu (cognitive 18) web-console/src/views/explore-view/components/control-pane/expression-menu.tsx:59— expression-menu.ExpressionMenu has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (7 pts), ternaries 3, error handling 1 (nesting depth added 3). Of this number, 10 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
aggregate.rewriteAggregate (cognitive 18) web-console/src/views/explore-view/query-macros/aggregate.ts:25— aggregate.rewriteAggregate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 28, 63, 67). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
execution-details-pane.ExecutionDetailsPane::renderContent (cognitive 18) web-console/src/views/workbench-view/execution-details-pane/execution-details-pane.tsx:59— execution-details-pane.ExecutionDetailsPane::renderContent has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 5, if/else 2 (4 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SeekableStreamSupervisor.getCurrentParseErrors (cognitive 17) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1942— SeekableStreamSupervisor.getCurrentParseErrors has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 3 (6 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SeekableStreamSupervisor.registerNewVersionOfPendingSegment (cognitive 17) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1509— SeekableStreamSupervisor.registerNewVersionOfPendingSegment has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (6 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
TaskQueue.start (cognitive 17) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java:220— TaskQueue.start has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (8 pts), loops 4 (5 pts), if/else 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParallelIndexSupervisorTask.publishSegments (cognitive 17) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1161— ParallelIndexSupervisorTask.publishSegments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexTask.generateAndPublishSegments (cognitive 17) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:810— IndexTask.generateAndPublishSegments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, ternaries 3 (4 pts), error handling 2, loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TaskLockHelper.verifyRootPartitionIsAdjacentAndAtomicUpdateGroupIsFull (cognitive 17) indexing-service/src/main/java/org/apache/druid/indexing/common/task/TaskLockHelper.java:260— TaskLockHelper.verifyRootPartitionIsAdjacentAndAtomicUpdateGroupIsFull has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskStorageDirTracker.findExistingTaskDirs (cognitive 17) indexing-service/src/main/java/org/apache/druid/indexing/common/TaskStorageDirTracker.java:175— TaskStorageDirTracker.findExistingTaskDirs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidConnection.close (cognitive 17) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnection.java:572— DruidConnection.close has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (4 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerImpl.computeShardColumns (cognitive 17) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1999— ControllerImpl.computeShardColumns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerImpl.handleQueryResults (cognitive 17) multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:1749— ControllerImpl.handleQueryResults has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanQueryKit.makeQueryDefinition (cognitive 17) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryKit.java:78— ScanQueryKit.makeQueryDefinition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MSQTaskSqlEngine.validateSortOrderBeginsWithTimeIfRequired (cognitive 17) multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java:469— MSQTaskSqlEngine.validateSortOrderBeginsWithTimeIfRequired has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
3.match (cognitive 17) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:65— 3.match has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeType.of (cognitive 17) processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:1083— RangeType.of has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypedInFilter.<init> (cognitive 17) processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:143— TypedInFilter.<init> has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ImmutableLookupExtractor.unapplyInternal (cognitive 17) processing/src/main/java/org/apache/druid/query/lookup/ImmutableLookupMap.java:204— ImmutableLookupExtractor.unapplyInternal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupByQuery.compareDims (cognitive 17) processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java:766— GroupByQuery.compareDims has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentAnalyzer.analyzeComplexColumn (cognitive 17) processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java:317— SegmentAnalyzer.analyzeComplexColumn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (4 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringTopNColumnAggregatesProcessor.scanAndAggregateWithCardinalityKnown (cognitive 17) processing/src/main/java/org/apache/druid/query/topn/types/StringTopNColumnAggregatesProcessor.java:144— StringTopNColumnAggregatesProcessor.scanAndAggregateWithCardinalityKnown has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (8 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CursorGranularizer.advanceToBucket (cognitive 17) processing/src/main/java/org/apache/druid/query/CursorGranularizer.java:143— CursorGranularizer.advanceToBucket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetadataStorageConnectorConfig.equals (cognitive 17) processing/src/main/java/org/apache/druid/metadata/MetadataStorageConnectorConfig.java:137— MetadataStorageConnectorConfig.equals has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 8 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FixedIndexed.getRange (cognitive 17) processing/src/main/java/org/apache/druid/segment/data/FixedIndexed.java:183— FixedIndexed.getRange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (7 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HiveCnfHelper.convertToCnfWithLimit (cognitive 17) processing/src/main/java/org/apache/druid/segment/filter/cnf/HiveCnfHelper.java:95— HiveCnfHelper.convertToCnfWithLimit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HiveCnfHelper.generateAllCombinations (cognitive 17) processing/src/main/java/org/apache/druid/segment/filter/cnf/HiveCnfHelper.java:181— HiveCnfHelper.generateAllCombinations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexedUtf8LexicographicalRangeIndexes.getRange (cognitive 17) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:192— IndexedUtf8LexicographicalRangeIndexes.getRange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (7 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.findNext (cognitive 17) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1497— 1.findNext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LazilyAllocatingHeapWriteOutBytes.ensureBytes (cognitive 17) processing/src/main/java/org/apache/druid/segment/writeout/LazilyAllocatingHeapWriteOutBytes.java:195— LazilyAllocatingHeapWriteOutBytes.ensureBytes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
V9IndexLoader.load (cognitive 17) processing/src/main/java/org/apache/druid/segment/IndexIO.java:570— V9IndexLoader.load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiteralAndZeroFillExpander.reset (cognitive 17) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1899— LiteralAndZeroFillExpander.reset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringFieldWriter.writeUtf8ByteBuffers (cognitive 17) processing/src/main/java/org/apache/druid/frame/field/StringFieldWriter.java:90— StringFieldWriter.writeUtf8ByteBuffers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrameFile.open (cognitive 17) processing/src/main/java/org/apache/druid/frame/file/FrameFile.java:175— FrameFile.open has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HyperLogLogCollector.estimateSparse (cognitive 17) processing/src/main/java/org/apache/druid/hll/HyperLogLogCollector.java:169— HyperLogLogCollector.estimateSparse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorMathBivariateLongProcessorFactory.asProcessor (cognitive 17) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateLongProcessorFactory.java:38— VectorMathBivariateLongProcessorFactory.asProcessor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
VectorMathBivariateProcessorFactory.asProcessor (cognitive 17) processing/src/main/java/org/apache/druid/math/expr/vector/VectorMathBivariateProcessorFactory.java:39— VectorMathBivariateProcessorFactory.asProcessor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
BinEqExpr.asBitmapColumnIndex (cognitive 17) processing/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java:284— BinEqExpr.asBitmapColumnIndex has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 7, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReservoirSegmentSampler.pickMovableSegmentsFrom (cognitive 17) server/src/main/java/org/apache/druid/server/coordinator/balancer/ReservoirSegmentSampler.java:54— ReservoirSegmentSampler.pickMovableSegmentsFrom has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloneHistoricals.createCurrentStatusMap (cognitive 17) server/src/main/java/org/apache/druid/server/coordinator/duty/CloneHistoricals.java:244— CloneHistoricals.createCurrentStatusMap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataSourcesResource.getServedSegmentsInInterval (cognitive 17) server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:565— DataSourcesResource.getServedSegmentsInInterval has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataSourcesResource.isHandOffComplete (cognitive 17) server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:918— DataSourcesResource.isHandOffComplete has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, error handling 1, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialSegmentBundleCacheEntry.mount (cognitive 17) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java:256— PartialSegmentBundleCacheEntry.mount has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 1 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageLocation.reclaimHelper (cognitive 17) server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:955— StorageLocation.reclaimHelper has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamAppenderatorDriver.startJob (cognitive 17) server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorDriver.java:118— StreamAppenderatorDriver.startJob has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FireHydrant.swapSegment (cognitive 17) server/src/main/java/org/apache/druid/segment/realtime/FireHydrant.java:111— FireHydrant.swapSegment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasourceDefn.validateProjections (cognitive 17) server/src/main/java/org/apache/druid/catalog/model/table/DatasourceDefn.java:168— DatasourceDefn.validateProjections has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 4 (6 pts), boolean chains 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuiltinApproxCountDistinctSqlAggregator.toDruidAggregation (cognitive 17) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/BuiltinApproxCountDistinctSqlAggregator.java:74— BuiltinApproxCountDistinctSqlAggregator.toDruidAggregation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimeArithmeticOperatorConversion.toDruidExpression (cognitive 17) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/TimeArithmeticOperatorConversion.java:66— TimeArithmeticOperatorConversion.toDruidExpression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DruidSqlValidator.validateCall (cognitive 17) sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidSqlValidator.java:764— DruidSqlValidator.validateCall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilterJoinExcludePushToChildRule.removeRedundantIsNotNullFilters (cognitive 17) sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRule.java:291— FilterJoinExcludePushToChildRule.removeRedundantIsNotNullFilters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlattenConcatShuttle.visitCall (cognitive 17) sql/src/main/java/org/apache/druid/sql/calcite/rule/FlattenConcatRule.java:79— FlattenConcatShuttle.visitCall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsulDruidNodeAnnouncer.updateHealthChecks (cognitive 17) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeAnnouncer.java:260— ConsulDruidNodeAnnouncer.updateHealthChecks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (6 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsulLeaderSelector.unregisterListener (cognitive 17) extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulLeaderSelector.java:162— ConsulLeaderSelector.unregisterListener has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (8 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EntryImpl.tryUpdateCache (cognitive 17) extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/CacheScheduler.java:227— EntryImpl.tryUpdateCache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JdbcCacheGenerator.generateCache (cognitive 17) extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/JdbcCacheGenerator.java:67— JdbcCacheGenerator.generateCache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (5 pts), ternaries 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
S3InputSourceDefn.convertArgsToSourceMap (cognitive 17) extensions-core/s3-extensions/src/main/java/org/apache/druid/catalog/model/table/S3InputSourceDefn.java:194— S3InputSourceDefn.convertArgsToSourceMap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
generate-binary-license.print_licenses_by_name (cognitive 17) distribution/bin/generate-binary-license.py:176— generate-binary-license.print_licenses_by_name has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (6 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
hjson-context.getHjsonContext (cognitive 17) web-console/src/editor-completions/hjson-context.ts:179— hjson-context.getHjsonContext has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
date.parseIsoDate (cognitive 17) web-console/src/utils/date.ts:134— date.parseIsoDate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 6, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WorkbenchQuery.getEffectiveEngine (cognitive 17) web-console/src/druid-models/workbench-query/workbench-query.ts:363— WorkbenchQuery.getEffectiveEngine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
segments-view.segmentFiltersToExpression (cognitive 17) web-console/src/views/segments-view/segments-view.tsx:156— segments-view.segmentFiltersToExpression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 4). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 158). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
services-view.AggregatedDetailCell (cognitive 17) web-console/src/views/services-view/services-view.tsx:329— services-view.AggregatedDetailCell has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
preview-table.PreviewTable (cognitive 17) web-console/src/views/sql-data-loader-view/schema-step/preview-table/preview-table.tsx:75— preview-table.PreviewTable has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, ternaries 5 (7 pts), if/else 3 (nesting depth added 2). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 114, hasFilterOnHeader). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
recent-query-task-panel.RecentQueryTaskPanel (cognitive 17) web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.tsx:84— recent-query-task-panel.RecentQueryTaskPanel has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 4, error handling 1 (2 pts), if/else 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 134, 148, 278). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WeightedCostFunction.computeCost (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/WeightedCostFunction.java:113— WeightedCostFunction.computeCost has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SeekableStreamSupervisor.getCurrentStats (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:1867— SeekableStreamSupervisor.getCurrentStats has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 3 (6 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
1.waitNextIteratorIfNecessary (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/RecordSupplierInputSource.java:149— 1.waitNextIteratorIfNecessary has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 2 (5 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (4917.waitNextIteratorIfNecessary) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
StreamChunkReader.parse (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/StreamChunkReader.java:118— StreamChunkReader.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (5 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRestorableTaskRunner.restore (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/overlord/BaseRestorableTaskRunner.java:86— BaseRestorableTaskRunner.restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
6675.call (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:164— 6675.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, error handling 5, boolean chains 2, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ParallelIndexSupervisorTask.doGetRowStatsAndUnparseableEventsParallelMultiPhase (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1706— ParallelIndexSupervisorTask.doGetRowStatsAndUnparseableEventsParallelMultiPhase has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialDimensionDistributionTask.determineDistribution (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java:264— PartialDimensionDistributionTask.determineDistribution has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TombstoneHelper.computeTombstoneIntervalsForReplace (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TombstoneHelper.java:198— TombstoneHelper.computeTombstoneIntervalsForReplace has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionTask.identifyMultiValuedDimensions (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:549— CompactionTask.identifyMultiValuedDimensions has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KillUnusedSegmentsTask.runTask (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/common/task/KillUnusedSegmentsTask.java:218— KillUnusedSegmentsTask.runTask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReindexingConfigBuilder.applyToWithDetails (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/compact/ReindexingConfigBuilder.java:135— ReindexingConfigBuilder.applyToWithDetails has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
4917.waitNextIteratorIfNecessary (cognitive 16) indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/RecordSupplierInputSource.java:149— 4917.waitNextIteratorIfNecessary has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 2 (5 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (1.waitNextIteratorIfNecessary) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MSQWorkerTaskLauncher.mainLoop (cognitive 16) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:442— MSQWorkerTaskLauncher.mainLoop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (3 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControllerStageTracker.setResultsCompleteForWorker (cognitive 16) multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerStageTracker.java:860— ControllerStageTracker.setResultsCompleteForWorker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SortMergeJoinStageProcessor.collectAndReadPartitions (cognitive 16) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/SortMergeJoinStageProcessor.java:328— SortMergeJoinStageProcessor.collectAndReadPartitions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupByPreShuffleFrameProcessor.runWithSegment (cognitive 16) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPreShuffleFrameProcessor.java:201— GroupByPreShuffleFrameProcessor.runWithSegment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanQueryFrameProcessor.runWithDataServerQuery (cognitive 16) multi-stage-query/src/main/java/org/apache/druid/msq/querykit/scan/ScanQueryFrameProcessor.java:258— ScanQueryFrameProcessor.runWithDataServerQuery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OvershadowableManager.checkVisibleIsFullyAvailableAndTryToMoveOvershadowedToVisible (cognitive 16) processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:534— OvershadowableManager.checkVisibleIsFullyAvailableAndTryToMoveOvershadowedToVisible has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (16 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
VersionedIntervalTimeline.remove (cognitive 16) processing/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java:766— VersionedIntervalTimeline.remove has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapInputRowParser.findDimensions (cognitive 16) processing/src/main/java/org/apache/druid/data/input/impl/MapInputRowParser.java:91— MapInputRowParser.findDimensions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetryingInputStream.openWithRetry (cognitive 16) processing/src/main/java/org/apache/druid/data/input/impl/RetryingInputStream.java:104— RetryingInputStream.openWithRetry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NumericFirstAggregator.aggregate (cognitive 16) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstAggregator.java:61— NumericFirstAggregator.aggregate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NumericFirstBufferAggregator.aggregate (cognitive 16) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/NumericFirstBufferAggregator.java:97— NumericFirstBufferAggregator.aggregate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NumericLastAggregator.aggregate (cognitive 16) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastAggregator.java:59— NumericLastAggregator.aggregate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NumericLastBufferAggregator.aggregate (cognitive 16) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java:100— NumericLastBufferAggregator.aggregate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
4.match (cognitive 16) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:166— 4.match has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (5.match) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
5.match (cognitive 16) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:204— 5.match has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (4.match) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
VectorGroupByEngineIterator.hasNext (cognitive 16) processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/VectorGroupByEngine.java:288— VectorGroupByEngineIterator.hasNext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanQueryLimitRowIterator.next (cognitive 16) processing/src/main/java/org/apache/druid/query/scan/ScanQueryLimitRowIterator.java:95— ScanQueryLimitRowIterator.next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanQueryRunnerFactory.mergeRunners (cognitive 16) processing/src/main/java/org/apache/druid/query/scan/ScanQueryRunnerFactory.java:85— ScanQueryRunnerFactory.mergeRunners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UseIndexesStrategy.getStartIndexOfTime (cognitive 16) processing/src/main/java/org/apache/druid/query/search/UseIndexesStrategy.java:220— UseIndexesStrategy.getStartIndexOfTime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TopNBinaryFn.apply (cognitive 16) processing/src/main/java/org/apache/druid/query/topn/TopNBinaryFn.java:76— TopNBinaryFn.apply has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 6 (7 pts) (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SegmentFileBuilderV10.close (cognitive 16) processing/src/main/java/org/apache/druid/segment/file/SegmentFileBuilderV10.java:421— SegmentFileBuilderV10.close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, loops 3 (4 pts), boolean chains 3, ternaries 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LookupJoinable.getCorrelatedColumnValues (cognitive 16) processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinable.java:135— LookupJoinable.getCorrelatedColumnValues has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BroadcastSegmentIndexedTable.<init> (cognitive 16) processing/src/main/java/org/apache/druid/segment/join/table/BroadcastSegmentIndexedTable.java:70— BroadcastSegmentIndexedTable.<init> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrameBasedIndexedTable.<init> (cognitive 16) processing/src/main/java/org/apache/druid/segment/join/table/FrameBasedIndexedTable.java:73— FrameBasedIndexedTable.<init> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (5 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JoinableFactoryWrapper.convertJoinsToFilters (cognitive 16) processing/src/main/java/org/apache/druid/segment/join/JoinableFactoryWrapper.java:65— JoinableFactoryWrapper.convertJoinsToFilters has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
NestedDataColumnSupplier.read (cognitive 16) processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSupplier.java:57— NestedDataColumnSupplier.read has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NestedVariantIndexes.getIndexes (cognitive 16) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1290— NestedVariantIndexes.getIndexes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NestedPathFinder.toNormalizedJsonPath (cognitive 16) processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:77— NestedPathFinder.toNormalizedJsonPath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DoubleValueSetIndexes.forSortedValues (cognitive 16) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:304— DoubleValueSetIndexes.forSortedValues has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ListFilteredLexicographicalRangeIndexes.getRange (cognitive 16) processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:667— ListFilteredLexicographicalRangeIndexes.getRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Metadata.mergeOrderings (cognitive 16) processing/src/main/java/org/apache/druid/segment/Metadata.java:365— Metadata.mergeOrderings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSet.maxLiteralLengthModulus (cognitive 16) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:141— ConciseSet.maxLiteralLengthModulus has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSet.size (cognitive 16) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1175— ConciseSet.size has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConciseSetUtils.maxLiteralLengthModulus (cognitive 16) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSetUtils.java:91— ConciseSetUtils.maxLiteralLengthModulus has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppendableMemory.reserveAdditional (cognitive 16) processing/src/main/java/org/apache/druid/frame/allocation/AppendableMemory.java:149— AppendableMemory.reserveAdditional has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetryUtils.retry (cognitive 16) processing/src/main/java/org/apache/druid/java/util/common/RetryUtils.java:112— RetryUtils.retry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IfDoubleVectorProcessor.evalVector (cognitive 16) processing/src/main/java/org/apache/druid/math/expr/vector/IfDoubleVectorProcessor.java:47— IfDoubleVectorProcessor.evalVector has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IfLongVectorProcessor.evalVector (cognitive 16) processing/src/main/java/org/apache/druid/math/expr/vector/IfLongVectorProcessor.java:47— IfLongVectorProcessor.evalVector has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HttpLoadQueuePeon.doSegmentManagement (cognitive 16) server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java:329— HttpLoadQueuePeon.doSegmentManagement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialSegmentStatusInTier.classify (cognitive 16) server/src/main/java/org/apache/druid/server/coordinator/loading/PartialSegmentStatusInTier.java:155— PartialSegmentStatusInTier.classify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentManager.dropSegment (cognitive 16) server/src/main/java/org/apache/druid/server/SegmentManager.java:426— SegmentManager.dropSegment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), error handling 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexerSQLMetadataStorageCoordinator.createNewPendingSegment (cognitive 16) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1415— IndexerSQLMetadataStorageCoordinator.createNewPendingSegment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 3 (6 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SqlSegmentsMetadataQuery.buildSegmentsTableQuery (cognitive 16) server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:1733— SqlSegmentsMetadataQuery.buildSegmentsTableQuery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SegmentLocalCacheManager.load (cognitive 16) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1385— SegmentLocalCacheManager.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractSegmentMetadataCache.addSegment (cognitive 16) server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:506— AbstractSegmentMetadataCache.addSegment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServiceLocation.fromUri (cognitive 16) server/src/main/java/org/apache/druid/rpc/ServiceLocation.java:86— ServiceLocation.fromUri has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MetricsEmittingProxyResponseListener.onFailure (cognitive 16) services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java:922— MetricsEmittingProxyResponseListener.onFailure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 2 (4 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoordinatorCustomDutyGroupsProvider.get (cognitive 16) services/src/main/java/org/apache/druid/cli/CliCoordinator.java:361— CoordinatorCustomDutyGroupsProvider.get has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentsTable.scan (cognitive 16) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:439— SegmentsTable.scan has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DruidSqlParser.getUnexpectedTokenString (cognitive 16) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParser.java:348— DruidSqlParser.getUnexpectedTokenString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DruidSqlParser.translateParseException (cognitive 16) sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParser.java:193— DruidSqlParser.translateParseException has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryHandler.plan (cognitive 16) sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java:191— QueryHandler.plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqlResourceCollectorShuttle.visit (cognitive 16) sql/src/main/java/org/apache/druid/sql/calcite/planner/SqlResourceCollectorShuttle.java:83— SqlResourceCollectorShuttle.visit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DruidQuery.toTopNQuery (cognitive 16) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:1270— DruidQuery.toTopNQuery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DruidRels.createMappingDataSource (cognitive 16) sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidRels.java:224— DruidRels.createMappingDataSource has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReverseLookupRule.toStringSet (cognitive 16) sql/src/main/java/org/apache/druid/sql/calcite/rule/ReverseLookupRule.java:652— ReverseLookupRule.toStringSet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmbariMetricsEmitter.emit (cognitive 16) extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitter.java:108— AmbariMetricsEmitter.emit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DropwizardEmitter.emit (cognitive 16) extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardEmitter.java:93— DropwizardEmitter.emit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GraphiteEmitterConfig.equals (cognitive 16) extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitterConfig.java:64— GraphiteEmitterConfig.equals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, ternaries 2 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PrometheusEmitterConfig.<init> (cognitive 16) extensions-contrib/prometheus-emitter/src/main/java/org/apache/druid/emitter/prometheus/PrometheusEmitterConfig.java:81— PrometheusEmitterConfig.<init> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3, boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TDigestGenerateSketchSqlAggregator.toDruidAggregation (cognitive 16) extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestGenerateSketchSqlAggregator.java:71— TDigestGenerateSketchSqlAggregator.toDruidAggregation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HllSketchBuildAggregatorFactory.formulateSketchUpdater (cognitive 16) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregatorFactory.java:166— HllSketchBuildAggregatorFactory.formulateSketchUpdater has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HllSketchBuildUtil.updateSketch (cognitive 16) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildUtil.java:35— HllSketchBuildUtil.updateSketch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LDAPCredentialsValidator.validateCredentials (cognitive 16) REDACTED:155— LDAPCredentialsValidator.validateCredentials has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoordinatorBasicAuthorizerMetadataStorageUpdater.initSuperUsersAndGroupMapping (cognitive 16) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:1141— CoordinatorBasicAuthorizerMetadataStorageUpdater.initSuperUsersAndGroupMapping has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, ternaries 2 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
LDAPRoleProvider.allowedLdapGroup (cognitive 16) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/LDAPRoleProvider.java:196— LDAPRoleProvider.allowedLdapGroup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApproximateHistogram.sum (cognitive 16) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1460— ApproximateHistogram.sum has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 6, boolean chains 2, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ApproximateHistogram.toBytesCompact (cognitive 16) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java:1249— ApproximateHistogram.toBytesCompact has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (6 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
UriCacheGenerator.generateCache (cognitive 16) extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/UriCacheGenerator.java:68— UriCacheGenerator.generateCache has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 3 (4 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
OrcStructConverter.tryConvertPrimitive (cognitive 16) extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcStructConverter.java:148— OrcStructConverter.tryConvertPrimitive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15 (16 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
check-licenses.check_license_files (cognitive 16) distribution/bin/check-licenses.py:371— check-licenses.check_license_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
console-table.ConsoleTable::sortColumn (cognitive 16) web-console/src/components/console-table/console-table.tsx:532— console-table.ConsoleTable::sortColumn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (console-table.ConsoleTable) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
parse-time-table.ParseTimeTable (cognitive 16) web-console/src/views/load-data-view/parse-time-table/parse-time-table.tsx:70— parse-time-table.ParseTimeTable has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 4, if/else 4 (nesting depth added 1). None of this is in the body itself: all 16 points belong to 5 function literals inside it that branch (lines 90, 132, 97, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LoadDataView.renderSpecStep (cognitive 16) web-console/src/views/load-data-view/load-data-view.tsx:3625— LoadDataView.renderSpecStep has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 7, if/else 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hjson-tokens.numberOrLiteralLength (cognitive 16) web-console/src/editor-languages/hjson-tokens.ts:90— hjson-tokens.numberOrLiteralLength has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Near-duplicate member family (15 members, 17 shared lines) · ×1
Near-duplicate member family (15 members, 17 shared lines) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:52— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:52-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:54-94 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:52-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:52-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:53-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java:53-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongMulProcessor.java:53-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongSubProcessor.java:53-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:53-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleDivProcessor.java:53-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleMulProcessor.java:53-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleSubProcessor.java:53-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:52-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java:52-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongSubProcessor.java:52-92 — These 15 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 15 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 15 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 6 shared lines) · ×1
Near-duplicate member family (4 members, 6 shared lines) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:871— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:871-894 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1354-1378 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1515-1535 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1544-1559 — These 4 members are variants of one another: a block of 6 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 48 shared lines) · ×1
Near-duplicate member family (3 members, 48 shared lines) processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:150— processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:150-242 | processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java:151-243 | processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java:139-231 — These 3 members are variants of one another: a block of 48 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 12 shared lines) · ×1
Near-duplicate member family (3 members, 12 shared lines) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:110— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:110-348 | processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:370-584 | processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java:129-318 — These 3 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (72 shared lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:758— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:758-912 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:888-1034 — These two members are variants of one another: 72 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (60 shared lines) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:264— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:264-406 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:311-458 — These two members are variants of one another: 60 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (47 shared lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:229— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:229-327 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:171-269 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (43 shared lines) processing/src/main/java/org/apache/druid/math/expr/vector/IfDoubleVectorProcessor.java:48— processing/src/main/java/org/apache/druid/math/expr/vector/IfDoubleVectorProcessor.java:48-99 | processing/src/main/java/org/apache/druid/math/expr/vector/IfLongVectorProcessor.java:48-100 — These two members are variants of one another: 43 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (39 shared lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:76— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:76-122 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentMover.java:73-144 — These two members are variants of one another: 39 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (115 corresponding lines) · ×1
Edited copy of a member (115 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:211— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:211-331 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:340-460 — These two members are one piece of code written twice and then edited apart: 115 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (16 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java:44— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAsinProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAtanProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCbrtProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCosProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCoshProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleExpProcessor.java:45-66 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleExpm1Processor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLog10Processor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLog1pProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLogProcessor.java:45-66 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSinProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSinhProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSqrtProcessor.java:45-62 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleTanProcessor.java:44-65 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleTanhProcessor.java:44-65 — These 16 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 16 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 16 times.
D4 · Code Duplication· Members sharing a duplicated core (15 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (15 members, 50+ identical tokens) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAcosProcessor.java:43— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAcosProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAsinProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAtanProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleCbrtProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleCosProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleCoshProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleExpProcessor.java:45-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleExpm1Processor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLog10Processor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLog1pProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLogProcessor.java:45-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleSinProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleSinhProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleTanProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleTanhProcessor.java:43-59 — These 15 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 15 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 15 times.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:60— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:60-72 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java:60-72 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java:73-85 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchBuildVectorAggregator.java:73-85 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildVectorAggregator.java:73-85 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregator.java:73-85 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:68-92 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java:68-92 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/LongCardinalityVectorProcessor.java:68-92 | processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanVectorAggregator.java:72-83 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication· Edited copy of a member (235 corresponding lines) · ×1
Edited copy of a member (235 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:305— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:305-539 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:380-615 — These two members are one piece of code written twice and then edited apart: 235 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (151 corresponding lines) · ×1
Edited copy of a member (151 corresponding lines) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:515— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:515-665 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:677-829 — These two members are one piece of code written twice and then edited apart: 151 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (98 corresponding lines) · ×1
Edited copy of a member (98 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:140— processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:140-252 | processing/src/main/java/org/apache/druid/segment/nested/NestedPathFinder.java:285-382 — These two members are one piece of code written twice and then edited apart: 98 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (112 corresponding lines) · ×1
Edited copy of a member (112 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:92— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayContainsOperatorConversion.java:92-203 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ArrayOverlapOperatorConversion.java:92-215 — These two members are one piece of code written twice and then edited apart: 112 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (81 corresponding lines) · ×1
Edited copy of a member (81 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:120— processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:120-217 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:117-197 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (97 corresponding lines) · ×1
Edited copy of a member (97 corresponding lines) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1424— server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1424-1520 | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1537-1648 — These two members are one piece of code written twice and then edited apart: 97 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:464— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:464-523 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:375-435 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (69 corresponding lines) · ×1
Edited copy of a member (69 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:77— sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArrayConcatSqlAggregator.java:77-145 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/ArraySqlAggregator.java:79-155 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (63 corresponding lines) · ×1
Edited copy of a member (63 corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:85— processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:85-147 | processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java:157-233 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (86 corresponding lines) · ×1
Edited copy of a member (86 corresponding lines) services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java:834— services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java:834-919 | services/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java:923-1014 — These two members are one piece of code written twice and then edited apart: 86 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (74 corresponding lines) · ×1
Edited copy of a member (74 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:233— processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:233-314 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:173-246 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (64 corresponding lines) · ×1
Edited copy of a member (64 corresponding lines) indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:167— indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/PendingTaskBasedWorkerProvisioningStrategy.java:167-237 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/autoscaling/SimpleWorkerProvisioningStrategy.java:119-182 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 82+ corresponding lines) · ×1
Edited copies of one member (3 members, 82+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:70— processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java:70-151 | processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java:65-146 | processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java:76-157 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 82 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (73 corresponding lines) · ×1
Edited copy of a member (73 corresponding lines) processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:103— processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:103-178 | processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:213-285 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (58 corresponding lines) · ×1
Edited copy of a member (58 corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:338— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:338-395 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:280-338 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (90 corresponding lines) · ×1
Edited copy of a member (90 corresponding lines) processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:905— processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:905-994 | processing/src/main/java/org/apache/druid/extendedset/intset/ConciseSet.java:1000-1090 — These two members are one piece of code written twice and then edited apart: 90 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 68+ corresponding lines) · ×1
Edited copies of one member (3 members, 68+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:378— processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:378-448 | processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:488-557 | processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:700-767 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 68 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 61+ corresponding lines) · ×1
Edited copies of one member (4 members, 61+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:804— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:804-888 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1112-1172 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:415-498 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:428-511 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 61 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 60+ corresponding lines) · ×1
Edited copies of one member (3 members, 60+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:815— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:815-875 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:426-485 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:439-498 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 60 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 45+ corresponding lines) · ×1
Edited copies of one member (3 members, 45+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:529— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:529-573 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java:675-727 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:404-456 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 45 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 23+ corresponding lines) · ×1
Edited copies of one member (6 members, 23+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:514— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:514-536 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:540-562 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:585-607 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:611-633 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:656-678 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:682-704 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (76 corresponding lines) · ×1
Edited copy of a member (76 corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:99— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:99-174 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:98-173 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (72 corresponding lines) · ×1
Edited copy of a member (72 corresponding lines) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:119— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:119-190 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:562-635 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (66 corresponding lines) · ×1
Edited copy of a member (66 corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1000— sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1000-1071 | sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:1125-1190 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 59+ corresponding lines) · ×1
Edited copies of one member (3 members, 59+ corresponding lines) processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:148— processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:148-206 | processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidgetImpl.java:264-323 | processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidgetImpl.java:327-388 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 59 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×1
Edited copy of a member (42 corresponding lines) server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java:707— server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java:707-748 | server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java:865-916 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 26+ corresponding lines) · ×1
Edited copies of one member (6 members, 26+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMaxVectorAggregator.java:71— processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMaxVectorAggregator.java:71-96 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMinVectorAggregator.java:71-96 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdFloatMaxVectorAggregator.java:71-96 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdFloatMinVectorAggregator.java:71-96 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdLongMaxVectorAggregator.java:71-96 | processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdLongMinVectorAggregator.java:71-96 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 43+ corresponding lines) · ×1
Edited copies of one member (3 members, 43+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:604— processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:604-652 | processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:655-697 | processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:700-743 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 46+ corresponding lines) · ×1
Edited copies of one member (3 members, 46+ corresponding lines) processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:123— processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java:123-168 | processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java:123-170 | processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java:123-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 46 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 52+ corresponding lines) · ×1
Edited copies of one member (5 members, 52+ corresponding lines) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:643— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:643-694 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:936-993 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1217-1273 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:563-615 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:587-640 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 52 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) processing/src/main/java/org/apache/druid/frame/write/RowBasedFrameWriter.java:162— processing/src/main/java/org/apache/druid/frame/write/RowBasedFrameWriter.java:162-205 | processing/src/main/java/org/apache/druid/frame/write/columnar/ColumnarFrameWriter.java:116-163 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 56+ corresponding lines) · ×1
Edited copies of one member (3 members, 56+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorFactory.java:158— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorFactory.java:158-213 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchAggregatorFactory.java:158-213 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorFactory.java:170-225 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 56 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 36+ corresponding lines) · ×1
Edited copies of one member (3 members, 36+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:254— processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:254-291 | processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:302-337 | processing/src/main/java/org/apache/druid/query/aggregation/AggregatorUtil.java:348-383 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 40+ corresponding lines) · ×1
Edited copies of one member (4 members, 40+ corresponding lines) processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:186— processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:186-245 | processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:268-318 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:475-514 | processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:516-573 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 38+ corresponding lines) · ×1
Edited copies of one member (3 members, 38+ corresponding lines) processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:198— processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:198-243 | processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:279-316 | processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:527-564 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:222— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:222-243 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java:317-338 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisor.java:169-191 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 21+ corresponding lines) · ×1
Edited copies of one member (4 members, 21+ corresponding lines) extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java:58— extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java:58-83 | extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java:65-94 | extensions-core/postgresql-metadata-storage/src/main/java/org/apache/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java:66-94 | server/src/main/java/org/apache/druid/metadata/storage/derby/DerbyMetadataStorageDruidModule.java:44-64 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 39+ corresponding lines) · ×1
Edited copies of one member (3 members, 39+ corresponding lines) extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:159— extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:159-199 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregatorFactory.java:229-267 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchAggregatorFactory.java:250-288 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 35+ corresponding lines) · ×1
Edited copies of one member (3 members, 35+ corresponding lines) extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingSerde.java:84— extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingSerde.java:84-121 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramSerde.java:125-164 | extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceSerde.java:81-115 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 26+ corresponding lines) · ×1
Edited copies of one member (4 members, 26+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchEstimateOperatorConversion.java:83— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchEstimateOperatorConversion.java:83-111 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchEstimateWithErrorBoundsOperatorConversion.java:82-111 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchSingleArgBaseOperatorConversion.java:71-96 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchEstimateWithErrorBoundsOperatorConversion.java:79-104 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 26+ corresponding lines) · ×1
Edited copies of one member (5 members, 26+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:275— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:275-300 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:308-339 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:347-375 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:386-415 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:426-454 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 33+ corresponding lines) · ×1
Edited copies of one member (5 members, 33+ corresponding lines) extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountAggregatorFactory.java:103— extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountAggregatorFactory.java:103-135 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchAggregatorFactory.java:160-196 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchAggregatorFactory.java:129-161 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorFactory.java:260-294 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregatorFactory.java:179-211 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 16+ corresponding lines) · ×1
Edited copies of one member (6 members, 16+ corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilesPostAggregator.java:132— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilesPostAggregator.java:132-147 | extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchQuantilePostAggregator.java:116-131 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchToQuantilesPostAggregator.java:127-142 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilesPostAggregator.java:118-133 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToQuantilesPostAggregator.java:118-133 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilesPostAggregator.java:118-133 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 28+ corresponding lines) · ×1
Edited copies of one member (4 members, 28+ corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:213— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:213-240 | extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:247-274 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskTuningConfig.java:268-299 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:291-322 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTaskLogs.java:169— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTaskLogs.java:169-189 | extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureTaskLogs.java:204-226 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TaskLogs.java:222-245 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 19+ corresponding lines) · ×1
Edited copies of one member (6 members, 19+ corresponding lines) processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:54— processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:54-72 | processing/src/main/java/org/apache/druid/frame/write/columnar/DoubleFrameMaker.java:75-93 | processing/src/main/java/org/apache/druid/frame/write/columnar/FloatFrameMaker.java:54-72 | processing/src/main/java/org/apache/druid/frame/write/columnar/FloatFrameMaker.java:75-93 | processing/src/main/java/org/apache/druid/frame/write/columnar/LongFrameMaker.java:54-72 | processing/src/main/java/org/apache/druid/frame/write/columnar/LongFrameMaker.java:75-93 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:160— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:160-179 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:198-217 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:221-240 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 7+ corresponding lines) · ×1
Edited copies of one member (6 members, 7+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:212— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:212-218 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:207-213 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:205-211 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java:206-212 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java:204-210 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastAggregatorFactory.java:203-209 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 17+ corresponding lines) · ×1
Edited copies of one member (6 members, 17+ corresponding lines) processing/src/main/java/org/apache/druid/segment/vector/BaseDoubleVectorValueSelector.java:51— processing/src/main/java/org/apache/druid/segment/vector/BaseDoubleVectorValueSelector.java:51-67 | processing/src/main/java/org/apache/druid/segment/vector/BaseDoubleVectorValueSelector.java:71-87 | processing/src/main/java/org/apache/druid/segment/vector/BaseFloatVectorValueSelector.java:51-67 | processing/src/main/java/org/apache/druid/segment/vector/BaseFloatVectorValueSelector.java:71-87 | processing/src/main/java/org/apache/druid/segment/vector/BaseLongVectorValueSelector.java:51-67 | processing/src/main/java/org/apache/druid/segment/vector/BaseLongVectorValueSelector.java:71-87 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 18+ corresponding lines) · ×1
Edited copies of one member (4 members, 18+ corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregator.java:57— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregator.java:57-75 | extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:71-89 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchAggregator.java:59-79 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchBufferAggregator.java:69-86 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 15+ corresponding lines) · ×1
Edited copies of one member (6 members, 15+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:182— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:182-196 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:176-190 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:175-189 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java:176-190 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java:174-188 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastAggregatorFactory.java:173-187 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 8+ corresponding lines) · ×1
Edited copies of one member (6 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxVectorAggregator.java:63— processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxVectorAggregator.java:63-70 | processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinVectorAggregator.java:63-70 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxVectorAggregator.java:63-70 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMinVectorAggregator.java:63-70 | processing/src/main/java/org/apache/druid/query/aggregation/LongMaxVectorAggregator.java:63-70 | processing/src/main/java/org/apache/druid/query/aggregation/LongMinVectorAggregator.java:63-70 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 12+ corresponding lines) · ×1
Edited copies of one member (8 members, 12+ corresponding lines) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToEstimatePostAggregator.java:137— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToEstimatePostAggregator.java:137-148 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToEstimateWithBoundsPostAggregator.java:142-153 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilePostAggregator.java:126-137 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToRankPostAggregator.java:126-137 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToQuantilePostAggregator.java:126-137 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToRankPostAggregator.java:126-137 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilePostAggregator.java:126-137 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToRankPostAggregator.java:126-137 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 8+ corresponding lines) · ×1
Edited copies of one member (7 members, 8+ corresponding lines) processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:60— processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:60-67 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:62-69 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:61-68 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:82-89 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:104-111 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:101-108 | processing/src/main/java/org/apache/druid/query/filter/vector/StringObjectVectorValueMatcher.java:74-81 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 12+ corresponding lines) · ×1
Edited copies of one member (6 members, 12+ corresponding lines) sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:105— sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:105-119 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:132-146 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:159-172 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/MaxSqlAggregator.java:63-76 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/MinSqlAggregator.java:60-71 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/SumSqlAggregator.java:74-85 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 10+ corresponding lines) · ×1
Edited copies of one member (5 members, 10+ corresponding lines) extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:224— extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:224-237 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchOperations.java:36-48 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchOperations.java:36-48 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchOperations.java:36-48 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchOperations.java:108-117 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 31+ corresponding lines) · ×1
Edited copies of one member (5 members, 31+ corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:44— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:44-75 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:45-75 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:46-83 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:1853-1887 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexTuningConfig.java:78-113 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 10+ corresponding lines) · ×1
Edited copies of one member (7 members, 10+ corresponding lines) processing/src/main/java/org/apache/druid/segment/data/LongsLongEncodingReader.java:56— processing/src/main/java/org/apache/druid/segment/data/LongsLongEncodingReader.java:56-67 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:445-456 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:480-491 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:734-745 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:757-768 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:847-858 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1140-1149 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 17+ corresponding lines) · ×1
Edited copies of one member (5 members, 17+ corresponding lines) processing/src/main/java/org/apache/druid/query/SinkQueryRunners.java:43— processing/src/main/java/org/apache/druid/query/SinkQueryRunners.java:43-59 | processing/src/main/java/org/apache/druid/segment/column/StringEncodingStrategies.java:141-157 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:383-399 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:650-666 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:675-691 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:141— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfig.java:141-168 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfig.java:115-141 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskTuningConfig.java:164-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:170— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:170-174 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:170-174 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:169-173 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 4+ corresponding lines) · ×1
Edited copies of one member (5 members, 4+ corresponding lines) processing/src/main/java/org/apache/druid/query/datasourcemetadata/DataSourceMetadataQuery.java:77— processing/src/main/java/org/apache/druid/query/datasourcemetadata/DataSourceMetadataQuery.java:77-80 | processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentMetadataQuery.java:218-221 | processing/src/main/java/org/apache/druid/query/search/SearchQuery.java:114-117 | processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQuery.java:111-114 | processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQuery.java:253-256 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×1
Edited copies of one member (4 members, 4+ corresponding lines) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:131— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchBufferAggregator.java:131-134 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregateHelper.java:125-131 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchBufferAggregator.java:127-130 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildBufferAggregatorHelper.java:134-137 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 4+ corresponding lines) · ×1
Edited copies of one member (6 members, 4+ corresponding lines) extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildBufferAggregator.java:108— extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountBuildBufferAggregator.java:108-111 | extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeBufferAggregator.java:103-106 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchBuildBufferAggregatorHelper.java:96-99 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchMergeBufferAggregatorHelper.java:99-102 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildBufferAggregatorHelper.java:103-106 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchMergeBufferAggregatorHelper.java:104-107 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×1
Edited copies of one member (4 members, 3+ corresponding lines) processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxAggregator.java:29— processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxAggregator.java:29-31 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMinAggregator.java:29-31 | processing/src/main/java/org/apache/druid/query/aggregation/FloatSumAggregator.java:35-37 | processing/src/main/java/org/apache/druid/segment/column/TypeStrategies.java:371-373 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (46–47 lines × 3) processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:391— processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:391-436 | processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:500-545 | processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:711-757 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:391` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:437` calls `getClass`, `toString` and `processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:546` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (47 lines × 2) processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:208— processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:208-254 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:423-469 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (45–46 lines × 2) services/src/main/java/org/apache/druid/cli/CreateTables.java:73— services/src/main/java/org/apache/druid/cli/CreateTables.java:73-117 | services/src/main/java/org/apache/druid/cli/ExportMetadata.java:216-261 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23–45 lines × 2) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1015— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1015-1059 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1447-1469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1015` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (42 lines × 2) server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:164— server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:164-205 | sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCache.java:110-151 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `serverView` to `CoordinatorServerView` in one and `TimelineServerView` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:206` calls `updateSchemaForRealtimeSegments` and `sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCache.java:152` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (36–41 lines × 2) processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:293— processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:293-328 | processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java:653-693 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java` and `processing/src/main/java/org/apache/druid/segment/filter/OrFilter.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/filter/AndFilter.java:293` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (36–39 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:517— processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:517-555 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:544-579 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:517` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (38 lines × 2) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:608— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:608-645 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:770-807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:608` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (35–37 lines × 2) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1438— server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1438-1474 | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1583-1617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (34–36 lines × 2) processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:90— processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:90-125 | processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidgetImpl.java:148-181 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (35–36 lines × 2) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:139— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:139-173 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:593-628 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java` and `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:139` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (35 lines × 4) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:834— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:834-868 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1131-1165 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:444-478 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:457-491 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:834` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:831` calls `get` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:441` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (35 lines × 2) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1340— server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1340-1374 | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:1539-1573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31–32 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1674— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1674-1705 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumnAndIndexSupplier.java:440-470 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1674` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (32 lines × 2) server/src/main/java/org/apache/druid/client/selector/PooledTierSelectorStrategy.java:96— server/src/main/java/org/apache/druid/client/selector/PooledTierSelectorStrategy.java:96-127 | server/src/main/java/org/apache/druid/client/selector/StrictTierSelectorStrategy.java:127-158 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/client/selector/PooledTierSelectorStrategy.java:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6–33 lines × 3) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:493— multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:493-524 | multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlTaskResource.java:276-308 | sql/src/main/java/org/apache/druid/sql/http/SqlResourceQueryResultPusher.java:135-140 — before extracting anything, compare `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java` and `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlTaskResource.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:493` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (28–30 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:608— indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:608-635 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:427-456 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:608` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `indexing-service/src/main/java/org/apache/druid/indexing/overlord/ThreadingTaskRunner.java:458` calls `shutdown` and `indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:636` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (29–30 lines × 2) processing/src/main/java/org/apache/druid/query/CursorGranularizer.java:58— processing/src/main/java/org/apache/druid/query/CursorGranularizer.java:58-86 | processing/src/main/java/org/apache/druid/query/vector/VectorCursorGranularizer.java:56-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (28–29 lines × 6) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:657— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:657-684 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:951-979 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1232-1259 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1472-1499 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:575-602 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:599-627 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:657` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25–28 lines × 2) services/src/main/java/org/apache/druid/cli/CliIndexer.java:197— services/src/main/java/org/apache/druid/cli/CliIndexer.java:197-221 | services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:212-239 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:212` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (27 lines × 4) processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:203— processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:203-229 | processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:283-309 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:481-507 | processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:531-557 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:201` calls `size` and `processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:281` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (27 lines × 3) processing/src/main/java/org/apache/druid/query/rowsandcols/column/DoubleArrayColumn.java:145— processing/src/main/java/org/apache/druid/query/rowsandcols/column/DoubleArrayColumn.java:145-171 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/IntArrayColumn.java:163-189 | processing/src/main/java/org/apache/druid/query/rowsandcols/column/LongArrayColumn.java:158-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `val` to `double` in one and `int` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (26–27 lines × 2) processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:407— processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:407-432 | processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:447-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/column/StringUtf8DictionaryEncodedColumn.java:407` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:933— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:933-959 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:992-1018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:933` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:990` calls `getMaxVectorSize` and `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:931` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (25 lines × 5) processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:117— processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:117-141 | processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:205-229 | processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:285-309 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:483-507 | processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:533-557 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:201` calls `size` and `processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:281` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21–25 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:901— indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:901-925 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:1182-1202 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:901` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22–25 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:473— multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:473-494 | multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlTaskResource.java:253-277 — before extracting anything, compare `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java` and `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlTaskResource.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:473` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–24 lines × 3) extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:118— extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:118-139 | extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java:116-138 | extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTuningConfig.java:136-159 — before extracting anything, compare `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java` and `extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTuningConfig.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfig.java:118` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–24 lines × 2) extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:501— extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:501-519 | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:579-602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java:501` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–24 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:176— indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:176-193 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:137-160 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (23–24 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:325— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:325-348 | processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:562-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:325` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:561` calls `of` and `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:324` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23 lines × 3) processing/src/main/java/org/apache/druid/math/expr/vector/IfDoubleVectorProcessor.java:49— processing/src/main/java/org/apache/druid/math/expr/vector/IfDoubleVectorProcessor.java:49-71 | processing/src/main/java/org/apache/druid/math/expr/vector/IfLongVectorProcessor.java:49-71 | processing/src/main/java/org/apache/druid/math/expr/vector/IfObjectVectorProcessor.java:43-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21–23 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/WorkerHolder.java:388— indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/WorkerHolder.java:388-410 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/WorkerHolder.java:433-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/WorkerHolder.java:388` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–23 lines × 2) processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:400— processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:400-422 | processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java:408-427 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java` and `processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:400` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/SimpleQueryableIndex.java:428` calls `get` and `processing/src/main/java/org/apache/druid/segment/PartialQueryableIndex.java:423` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 4) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:80— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:80-101 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:325-346 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:530-551 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:554-575 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java` and `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:80` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java:78` calls `getRange`, `leftInt`, `rightInt` and `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:324` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21–22 lines × 4) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:941— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:941-962 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:1000-1021 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:144-165 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:804-824 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:941` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 3) processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:159— processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:159-180 | processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java:160-181 | processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java:148-169 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java` and `processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20–22 lines × 3) processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:150— processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:150-171 | processing/src/main/java/org/apache/druid/segment/projections/RollupTableProjectionSchema.java:90-109 | processing/src/main/java/org/apache/druid/segment/projections/TableProjectionSchema.java:89-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/segment/projections/ClusteredValueGroupsBaseTableSchema.java:177` calls `setSummary` and `processing/src/main/java/org/apache/druid/segment/projections/RollupTableProjectionSchema.java:110` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18–22 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:80— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:80-97 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchBaseSqlAggregator.java:74-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–22 lines × 2) server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java:818— server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java:818-836 | server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java:869-890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java:818` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–22 lines × 2) services/src/main/java/org/apache/druid/cli/CliOverlord.java:563— services/src/main/java/org/apache/druid/cli/CliOverlord.java:563-584 | services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java:102-122 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CliOverlord.java` and `services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 3) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:212— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:212-232 | extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentPuller.java:137-157 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java:245-265 — before extracting anything, compare `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java` and `extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentPuller.java:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–21 lines × 3) extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/sql/Bitmap64ExactCountSqlAggregator.java:155— extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/sql/Bitmap64ExactCountSqlAggregator.java:155-172 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:137-157 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/sql/ArrayOfDoublesSketchSqlAggregator.java:119-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (16–21 lines × 2) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:306— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:306-321 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:374-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:306` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (43 lines × 2) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:466— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:466-508 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:379-421 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:466` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:276— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:276-296 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:314-332 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:276` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:334` calls `currentTimeMillis`, `reportMessageGap`, `getTimestampFromEpoch` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:298` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 6) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:891— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:891-910 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:946-965 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:1005-1024 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java:149-168 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java:150-169 | processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:808-827 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java:891` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 3) indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java:78— indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java:78-97 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/MoveTask.java:86-105 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/RestoreTask.java:79-98 — before extracting anything, compare `indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java` and `indexing-service/src/main/java/org/apache/druid/indexing/common/task/RestoreTask.java` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19–20 lines × 2) indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:816— indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:816-835 | indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java:924-942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–20 lines × 2) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:163— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:163-182 | processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:375-391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–20 lines × 2) server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:2733— server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:2733-2747 | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:2776-2795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:2733` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 7) processing/src/main/java/org/apache/druid/segment/index/IndexedStringDruidPredicateIndexes.java:68— processing/src/main/java/org/apache/druid/segment/index/IndexedStringDruidPredicateIndexes.java:68-86 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:660-678 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:954-972 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1235-1253 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1475-1493 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:578-596 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:602-620 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/IndexedStringDruidPredicateIndexes.java:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–19 lines × 4) extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestSketchQuantileSqlAggregator.java:86— extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestSketchQuantileSqlAggregator.java:86-104 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:95-111 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:76-92 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:78-94 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–19 lines × 3) processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:76— processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:76-92 | processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:104-122 | processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:134-151 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/ExpressionDruidPredicateFactory.java:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–19 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:150— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:150-168 | sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/BuiltinApproxCountDistinctSqlAggregator.java:117-132 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 6) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssStorageDruidModule.java:48— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssStorageDruidModule.java:48-65 | extensions-contrib/cassandra-storage/src/main/java/org/apache/druid/storage/cassandra/CassandraDruidModule.java:54-71 | extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureStorageDruidModule.java:56-73 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageDruidModule.java:65-82 | processing/src/main/java/org/apache/druid/initialization/TombstoneDataStorageModule.java:37-54 | server/src/main/java/org/apache/druid/guice/LocalDataStorageDruidModule.java:95-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssStorageDruidModule.java:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–18 lines × 2) services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:184— services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:184-201 | services/src/main/java/org/apache/druid/cli/CliOverlord.java:357-371 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CliMiddleManager.java` and `services/src/main/java/org/apache/druid/cli/CliOverlord.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 3) services/src/main/java/org/apache/druid/cli/CliOverlord.java:558— services/src/main/java/org/apache/druid/cli/CliOverlord.java:558-574 | services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java:134-149 | services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java:131-146 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CliOverlord.java` and `services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–17 lines × 3) processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:191— processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:191-207 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:231-247 | processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:588-591 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 4) processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:535— processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:535-550 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:583-598 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:697-712 | processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:745-760 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:535` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–16 lines × 3) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:62— processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:62-77 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:130-143 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:180-195 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 3) services/src/main/java/org/apache/druid/cli/CliOverlord.java:561— services/src/main/java/org/apache/druid/cli/CliOverlord.java:561-576 | services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java:100-114 | services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java:134-148 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CliOverlord.java` and `services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/src/main/java/org/apache/druid/cli/CliOverlord.java:579` calls `addFilter`, `FilterHolder`, `getInstance` and `services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java:149` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–16 lines × 2) server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:891— server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:891-903 | server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:1008-1023 — before extracting anything, compare `server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java` and `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:1008` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) services/src/main/java/org/apache/druid/server/router/TieredBrokerHostSelector.java:189— services/src/main/java/org/apache/druid/server/router/TieredBrokerHostSelector.java:189-203 | services/src/main/java/org/apache/druid/server/router/TieredBrokerHostSelector.java:276-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/src/main/java/org/apache/druid/server/router/TieredBrokerHostSelector.java:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 5) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1614— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1614-1628 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:281-295 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:397-411 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:281-295 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:410-424 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1614` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–15 lines × 4) indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:297— indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:297-306 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:317-326 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:364-378 | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:391-405 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:297` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 3) extensions-core/testing-tools/src/main/java/org/apache/druid/testing/cli/CliEventCollector.java:138— extensions-core/testing-tools/src/main/java/org/apache/druid/testing/cli/CliEventCollector.java:138-150 | services/src/main/java/org/apache/druid/cli/MiddleManagerJettyServerInitializer.java:84-96 | services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java:138-152 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/MiddleManagerJettyServerInitializer.java` and `services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java:137` calls `addAllowOptionsFilter`, `isAllowUnauthenticatedHttpOptions` and `extensions-core/testing-tools/src/main/java/org/apache/druid/testing/cli/CliEventCollector.java:136` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–15 lines × 2) processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:368— processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:368-382 | processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:397-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:368` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–15 lines × 2) server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:377— server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:377-391 | server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:464-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java:377` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:332— server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:332-346 | server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:398-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 8) processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:217— processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:217-230 | processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:297-310 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:495-508 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:856-869 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1153-1166 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:466-479 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:479-492 | processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java:545-558 — there are 8 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:217` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 6) processing/src/main/java/org/apache/druid/query/filter/vector/ArrayVectorValueMatcher.java:65— processing/src/main/java/org/apache/druid/query/filter/vector/ArrayVectorValueMatcher.java:65-78 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:45-58 | processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:96-109 | processing/src/main/java/org/apache/druid/query/filter/vector/ObjectVectorValueMatcher.java:74-87 | processing/src/main/java/org/apache/druid/query/filter/vector/StringObjectVectorValueMatcher.java:47-60 | processing/src/main/java/org/apache/druid/query/filter/vector/StringObjectVectorValueMatcher.java:88-101 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java` and `processing/src/main/java/org/apache/druid/query/filter/vector/StringObjectVectorValueMatcher.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/ArrayVectorValueMatcher.java:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (2–14 lines × 8) services/src/main/java/org/apache/druid/cli/CliHistorical.java:100— services/src/main/java/org/apache/druid/cli/CliHistorical.java:100-102 | services/src/main/java/org/apache/druid/cli/CliIndexer.java:140-141 | services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:128-129 | services/src/main/java/org/apache/druid/cli/CliPeon.java:239-240 | services/src/main/java/org/apache/druid/cli/CliRouter.java:95-97 | services/src/main/java/org/apache/druid/cli/DumpSegment.java:759-769 | services/src/main/java/org/apache/druid/cli/ValidateSegments.java:78-91 | services/src/main/java/org/apache/druid/cli/validate/DruidJsonValidator.java:77-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `services/src/main/java/org/apache/druid/cli/CliHistorical.java:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:131` calls `bindConstant`, `annotatedWith`, `to` and `services/src/main/java/org/apache/druid/cli/CliRouter.java:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 8) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:354— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:354-366 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:658-670 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:677-689 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:696-708 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:715-727 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:734-746 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:753-765 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/CoordinatorBasicAuthorizerMetadataStorageUpdater.java:853-865 — there are 8 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:354` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 8) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:69— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:69-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java:69-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongMulProcessor.java:69-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongSubProcessor.java:69-80 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:69-81 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleDivProcessor.java:69-81 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleMulProcessor.java:69-81 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleSubProcessor.java:69-81 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:81` calls `fromArray` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:81` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 7) processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:736— processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:736-748 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1034-1046 | processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:1614-1626 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:281-293 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:397-409 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:281-293 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:410-422 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:736` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 5) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchUtils.java:83— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchUtils.java:83-94 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchUtils.java:92-103 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java:136-147 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java:161-173 | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregator.java:123-135 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchApproxQuantileSqlAggregator.java` and `extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregator.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 5) services/src/main/java/org/apache/druid/cli/CliOverlord.java:561— services/src/main/java/org/apache/druid/cli/CliOverlord.java:561-575 | services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java:100-113 | services/src/main/java/org/apache/druid/cli/MiddleManagerJettyServerInitializer.java:84-96 | services/src/main/java/org/apache/druid/cli/QueryJettyServerInitializer.java:138-150 | services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java:134-147 — before extracting anything, compare `services/src/main/java/org/apache/druid/cli/CliOverlord.java` and `services/src/main/java/org/apache/druid/cli/CoordinatorJettyServerInitializer.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/src/main/java/org/apache/druid/cli/CliOverlord.java:579` calls `addFilter`, `FilterHolder`, `getInstance` and `services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java:149` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–13 lines × 3) processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:156— processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:156-168 | processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidgetImpl.java:275-287 | processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidgetImpl.java:340-349 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/key/ByteRowKeyComparator.java:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:266— server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:266-278 | server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:320-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/coordinator/loading/StrategicSegmentAssigner.java:266` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–12 lines × 4) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java:51— extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java:51-58 | extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java:60-67 | extensions-contrib/druid-ranger-security/src/main/java/org/apache/druid/security/ranger/authorizer/RangerSecurityDruidModule.java:46-57 | extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageDruidModule.java:86-97 — before extracting anything, compare `extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/common/DeltaLakeDruidModule.java` and `extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 15) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:82— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:82-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:84-94 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:82-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:82-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:85-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java:85-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongMulProcessor.java:85-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongSubProcessor.java:85-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:85-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleDivProcessor.java:85-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleMulProcessor.java:85-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleSubProcessor.java:85-95 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:82-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java:82-92 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongSubProcessor.java:82-92 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:82` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:83` calls `fromArray` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:83` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–11 lines × 4) services/src/main/java/org/apache/druid/cli/CliBroker.java:188— services/src/main/java/org/apache/druid/cli/CliBroker.java:188-198 | services/src/main/java/org/apache/druid/cli/CliHistorical.java:125-135 | services/src/main/java/org/apache/druid/cli/CliIndexer.java:185-195 | services/src/main/java/org/apache/druid/cli/CliRouter.java:123-130 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `services/src/main/java/org/apache/druid/cli/CliIndexer.java:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/src/main/java/org/apache/druid/cli/CliHistorical.java:120` calls `register`, `bind`, `install` and `services/src/main/java/org/apache/druid/cli/CliIndexer.java:183` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–11 lines × 3) processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:72— processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:72-82 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:137-145 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:174-184 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 3) server/src/main/java/org/apache/druid/server/initialization/AuthenticatorMapperModule.java:94— server/src/main/java/org/apache/druid/server/initialization/AuthenticatorMapperModule.java:94-103 | server/src/main/java/org/apache/druid/server/initialization/AuthorizerMapperModule.java:124-134 | services/src/main/java/org/apache/druid/cli/CliCoordinator.java:386-395 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/initialization/AuthenticatorMapperModule.java:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 2) server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1080— server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1080-1090 | server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1827-1835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1077` calls `setOnUnmount`, `deleteSegmentInfoFile` and `server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:1825` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 3) processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java:236— processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java:236-244 | processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java:327-336 | processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:325-333 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java` and `processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 312 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java:236` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 6) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAbsProcessor.java:48— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAbsProcessor.java:48-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleNegProcessor.java:48-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleSqrtProcessor.java:50-58 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongAbsProcessor.java:48-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongNegProcessor.java:48-56 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSqrtProcessor.java:54-62 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAbsProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleNegProcessor.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAbsProcessor.java:48` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `double[]` in one and `long[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8–9 lines × 6) processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:79— processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:79-86 | processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:115-123 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:81-89 | processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java:117-125 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:80-88 | processing/src/main/java/org/apache/druid/query/filter/vector/LongVectorValueMatcher.java:116-124 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java` and `processing/src/main/java/org/apache/druid/query/filter/vector/FloatVectorValueMatcher.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/DoubleVectorValueMatcher.java:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:193— processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:193-201 | processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java:193-201 | processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java:192-200 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java:232-240 | processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:447-455 — before extracting anything, compare `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java` and `processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–9 lines × 4) processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:467— processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:467-473 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexed.java:491-499 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:380-386 | processing/src/main/java/org/apache/druid/segment/data/FrontCodedIntArrayIndexedWriter.java:404-412 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–9 lines × 3) server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:250— server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:250-258 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:285-293 | server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:331-338 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java:250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6–9 lines × 3) server/src/main/java/org/apache/druid/server/metrics/HistoricalMetricsMonitor.java:87— server/src/main/java/org/apache/druid/server/metrics/HistoricalMetricsMonitor.java:87-93 | server/src/main/java/org/apache/druid/server/metrics/HistoricalMetricsMonitor.java:102-110 | server/src/main/java/org/apache/druid/server/metrics/SegmentStatsMonitor.java:81-86 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–9 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:303— sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:303-309 | sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:370-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/planner/IngestHandler.java:303` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `sqlNode` to `DruidSqlIngest` in one and `DruidSqlReplace` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7–8 lines × 8) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:54— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:54-60 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java:54-60 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongMulProcessor.java:54-60 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongSubProcessor.java:54-60 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:54-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleDivProcessor.java:54-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleMulProcessor.java:54-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleSubProcessor.java:54-61 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:61` calls `fromArray` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:61` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 3) processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:171— processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:171-178 | processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java:381-387 | processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java:428-435 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java` and `processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 12) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:65— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:65-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:67-73 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:65-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:65-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:67-73 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java:67-73 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongMulProcessor.java:67-73 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongSubProcessor.java:67-73 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:67-73 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleDivProcessor.java:67-73 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleMulProcessor.java:67-73 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleSubProcessor.java:67-73 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (2–7 lines × 5) processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:901— processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:901-907 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1013-1019 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1053-1054 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1058-1064 | processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:1104-1110 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java:901` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 16) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java:45— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAsinProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAtanProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCbrtProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCosProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCoshProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleExpProcessor.java:46-51 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleExpm1Processor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLog10Processor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLog1pProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLogProcessor.java:46-51 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSinProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSinhProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSqrtProcessor.java:46-51 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleTanProcessor.java:45-50 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleTanhProcessor.java:45-50 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAsinProcessor.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 15) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:64— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:64-69 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleMulProcessor.java:64-69 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleSubProcessor.java:64-69 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongDivProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongMulProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongSubProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleDivProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleMulProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleSubProcessor.java:66-71 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongAddProcessor.java:64-69 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongMulProcessor.java:64-69 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongLongSubProcessor.java:64-69 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongDoubleAddProcessor.java:63` calls `fromArray` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLongAddProcessor.java:63` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 7) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:872— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:872-877 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1116-1121 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1282-1287 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1355-1360 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1498-1503 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1516-1521 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1545-1550 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:872` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1288` calls `ColumnMetadata` and `jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1122` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5–6 lines × 3) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:879— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:879-883 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1167-1172 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1523-1527 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–6 lines × 3) processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:84— processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:84-89 | processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:102-104 | processing/src/main/java/org/apache/druid/query/filter/vector/StringObjectVectorValueMatcher.java:76-81 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java` and `processing/src/main/java/org/apache/druid/query/filter/vector/StringObjectVectorValueMatcher.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:84` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringObjectVectorValueMatcher.java:84` calls `castForEqualityComparison` and `processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java:102` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 8) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:62— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:62-66 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java:62-66 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchBuildVectorAggregator.java:75-80 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchBuildVectorAggregator.java:75-80 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildVectorAggregator.java:75-80 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java:75-79 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java:75-79 | processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/LongCardinalityVectorProcessor.java:75-79 — before extracting anything, compare `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java` and `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 15) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAcosProcessor.java:43— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAcosProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAsinProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleAtanProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleCbrtProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleCosProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleCoshProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleExpProcessor.java:45-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleExpm1Processor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLog10Processor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLog1pProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleLogProcessor.java:45-61 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleSinProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleSinhProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleTanProcessor.java:43-59 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleTanhProcessor.java:43-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 15 call sites, so a change lands once.
Duplicated block (24 lines × 5) extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/filter/DeltaEqualsFilter.java:42— extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/filter/DeltaEqualsFilter.java:42-65 | extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/filter/DeltaGreaterThanFilter.java:42-65 | extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/filter/DeltaGreaterThanOrEqualsFilter.java:42-65 | extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/filter/DeltaLessThanFilter.java:42-65 | extensions-contrib/druid-deltalake-extensions/src/main/java/org/apache/druid/delta/filter/DeltaLessThanOrEqualsFilter.java:42-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (48 lines × 2) extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchBuildBufferAggregator.java:40— extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchBuildBufferAggregator.java:40-88 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllSketchMergeBufferAggregator.java:38-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `helper` to `KllSketchBuildBufferAggregatorHelper<SketchType>` in one and `KllSketchMergeBufferAggregatorHelper<SketchType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (72 lines × 2) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/NoopBasicAuthenticatorMetadataStorageUpdater.java:1— extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/NoopBasicAuthenticatorMetadataStorageUpdater.java:1-72 | extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/NoopBasicAuthorizerMetadataStorageUpdater.java:1-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/NoopBasicAuthenticatorMetadataStorageUpdater.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (57 lines × 2) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/httpclient/jdk/DruidKubernetesJdkHttpClientConfig.java:1— extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/httpclient/jdk/DruidKubernetesJdkHttpClientConfig.java:1-57 | extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/httpclient/okhttp/DruidKubernetesOkHttpHttpClientConfig.java:1-65 — before extracting anything, compare `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/httpclient/jdk/DruidKubernetesJdkHttpClientConfig.java` and `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/httpclient/okhttp/DruidKubernetesOkHttpHttpClientConfig.java` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/httpclient/jdk/DruidKubernetesJdkHttpClientConfig.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (30 lines × 3) processing/src/main/java/org/apache/druid/segment/column/DoublesColumnWithNulls.java:38— processing/src/main/java/org/apache/druid/segment/column/DoublesColumnWithNulls.java:38-67 | processing/src/main/java/org/apache/druid/segment/column/FloatsColumnWithNulls.java:38-67 | processing/src/main/java/org/apache/druid/segment/column/LongsColumnWithNulls.java:38-67 — before extracting anything, compare `processing/src/main/java/org/apache/druid/segment/column/DoublesColumnWithNulls.java` and `processing/src/main/java/org/apache/druid/segment/column/FloatsColumnWithNulls.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (159 lines × 2) server/src/main/java/org/apache/druid/client/coordinator/NoopCoordinatorClient.java:1— server/src/main/java/org/apache/druid/client/coordinator/NoopCoordinatorClient.java:1-159 | server/src/main/java/org/apache/druid/rpc/indexing/NoopOverlordClient.java:1-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/druid/client/coordinator/NoopCoordinatorClient.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (62 lines × 2) sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/MillisToTimestampOperatorConversion.java:1— sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/MillisToTimestampOperatorConversion.java:1-62 | sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/TimestampToMillisOperatorConversion.java:1-62 — before extracting anything, compare `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/MillisToTimestampOperatorConversion.java` and `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/TimestampToMillisOperatorConversion.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/MillisToTimestampOperatorConversion.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 6) extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTaskLogs.java:119— extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTaskLogs.java:119-123 | extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssTaskLogs.java:127-131 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TaskLogs.java:90-94 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TaskLogs.java:164-168 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TaskLogs.java:172-176 | extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TaskLogs.java:180-184 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 9) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregatorFactory.java:158— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregatorFactory.java:158-164 | extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java:209-215 | extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregatorFactory.java:169-175 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchAggregatorFactory.java:175-181 | extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampAggregatorFactory.java:146-152 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java:192-198 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java:179-185 | processing/src/main/java/org/apache/druid/query/aggregation/SimpleLongAggregatorFactory.java:182-188 | processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java:196-202 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/SimpleDoubleAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/SimpleFloatAggregatorFactory.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 6) extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilesPostAggregator.java:122— extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilesPostAggregator.java:122-128 | extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchQuantilePostAggregator.java:106-112 | extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchToQuantilesPostAggregator.java:117-123 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilesPostAggregator.java:108-114 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToQuantilesPostAggregator.java:108-114 | extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilesPostAggregator.java:108-114 — before extracting anything, compare `extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilesPostAggregator.java` and `extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchQuantilePostAggregator.java` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 13) extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:682— extensions-core/lookups-cached-global/src/main/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespace.java:682-691 | processing/src/main/java/org/apache/druid/java/util/common/granularity/AllGranularity.java:100-109 | processing/src/main/java/org/apache/druid/java/util/common/granularity/NoneGranularity.java:92-101 | processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java:103-111 | processing/src/main/java/org/apache/druid/query/filter/NullFilter.java:272-280 | processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:82-91 | processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:270-279 | processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:326-334 | processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:428-436 | processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:481-490 | processing/src/main/java/org/apache/druid/query/policy/NoRestrictionPolicy.java:63-71 | processing/src/main/java/org/apache/druid/query/policy/NoopPolicyEnforcer.java:47-55 | processing/src/main/java/org/apache/druid/timeline/partition/SingleElementPartitionChunk.java:83-92 — there are 13 copies across 9 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 13 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 5) jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnection.java:498— jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidConnection.java:498-503 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1569-1574 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidResultSet.java:1486-1491 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidResultSetMetaData.java:240-245 | jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidStatement.java:501-506 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (6 lines × 9) multi-stage-query/src/main/java/org/apache/druid/msq/counters/NilQueryCounterSnapshot.java:54— multi-stage-query/src/main/java/org/apache/druid/msq/counters/NilQueryCounterSnapshot.java:54-59 | processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:532-537 | processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:182-187 | processing/src/main/java/org/apache/druid/segment/column/BitmapIndexType.java:289-294 | processing/src/main/java/org/apache/druid/segment/column/StringBitmapIndexType.java:51-56 | processing/src/main/java/org/apache/druid/segment/column/StringBitmapIndexType.java:83-88 | processing/src/main/java/org/apache/druid/segment/column/StringEncodingStrategy.java:68-73 | server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:1188-1193 | server/src/main/java/org/apache/druid/segment/metadata/AbstractSegmentMetadataCache.java:1231-1236 — there are 9 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 11) multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/BroadcastTablesTooLargeFault.java:71— multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/BroadcastTablesTooLargeFault.java:71-76 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/RowTooLargeFault.java:58-63 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyBucketsFault.java:59-64 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyClusteredByColumnsFault.java:71-76 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyColumnsFault.java:62-67 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyInputFilesFault.java:83-88 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyPartitionsFault.java:58-63 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyRowsInAWindowFault.java:73-78 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyRowsWithSameKeyFault.java:80-85 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManySegmentsInTimeChunkFault.java:109-114 | multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyWorkersFault.java:62-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 11 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 5) processing/src/main/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregator.java:98— processing/src/main/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregator.java:98-104 | processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java:67-73 | processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java:67-73 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java:67-73 | processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java:67-73 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java` and `processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 9) processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregatorFactory.java:95— processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregatorFactory.java:95-103 | processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinAggregatorFactory.java:95-103 | processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumAggregatorFactory.java:95-103 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxAggregatorFactory.java:95-103 | processing/src/main/java/org/apache/druid/query/aggregation/FloatMinAggregatorFactory.java:95-103 | processing/src/main/java/org/apache/druid/query/aggregation/FloatSumAggregatorFactory.java:95-103 | processing/src/main/java/org/apache/druid/query/aggregation/LongMaxAggregatorFactory.java:95-103 | processing/src/main/java/org/apache/druid/query/aggregation/LongMinAggregatorFactory.java:95-103 | processing/src/main/java/org/apache/druid/query/aggregation/LongSumAggregatorFactory.java:120-128 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 9 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 12) processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:121— processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:121-136 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java:140-155 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:112-127 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstAggregatorFactory.java:131-146 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:111-126 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstAggregatorFactory.java:130-145 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java:110-125 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java:150-165 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java:108-123 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastAggregatorFactory.java:127-142 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastAggregatorFactory.java:109-124 | processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/LongLastAggregatorFactory.java:128-143 — before extracting anything, compare `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/first/DoubleFirstAggregatorFactory.java` and `processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/DoubleLastAggregatorFactory.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 15) processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java:53— processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAsinProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAtanProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCbrtProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCosProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleCoshProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleExpProcessor.java:54-58 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleExpm1Processor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLog10Processor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLog1pProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleLogProcessor.java:54-58 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSinProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleSinhProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleTanProcessor.java:53-57 | processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleTanhProcessor.java:53-57 — before extracting anything, compare `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java` and `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAsinProcessor.java` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdLongToDoubleAcosProcessor.java:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Unstable project druid-testing-tools — druid-testing-tools has instability 0.83 with 1 dependents.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplication concentrated across 6 sibling directories (47 clone groups) web-console/src/components/record-table-pane/record-table-pane.tsx:149— 47 duplicated blocks under web-console/src/ have copies in at least two of the sibling directories components, dialogs, druid-models, helpers, utils, views — 27 of them are reported below, and 20 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 47 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 47 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 47 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 10 sibling directories (46 clone groups) web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:101— 46 duplicated blocks under web-console/src/views/ have copies in at least two of the sibling directories datasources-view, explore-view, load-data-view, lookups-view, segments-view, services-view (+4 more sibling(s) not listed) — 26 of them are reported below, and 20 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 46 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 46 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 46 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 20 sibling directories (17 clone groups) web-console/src/dialogs/coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog.tsx:41— 17 duplicated blocks under web-console/src/dialogs/ have copies in at least two of the sibling directories about-dialog, async-action-dialog, broker-dynamic-config-dialog, compaction-dynamic-config-dialog, coordinator-dynamic-config-dialog, datasource-table-action-dialog (+14 more sibling(s) not listed) — 9 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 17 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 6 sibling directories (7 clone groups) web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:103— 7 duplicated blocks under web-console/src/views/explore-view/modules/ have copies in at least two of the sibling directories bar-chart-module, grouping-table-module, multi-axis-chart-module, pie-chart-module, record-table-module, time-chart-module — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 10 sibling directories (6 clone groups) web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:39— 6 duplicated blocks under web-console/src/views/workbench-view/ have copies in at least two of the sibling directories current-dart-panel, execution-details-dialog, execution-details-pane-loader, execution-stages-pane-loader, execution-submit-dialog, explain-dialog (+4 more sibling(s) not listed) — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (5 clone groups) web-console/src/views/workbench-view/column-tree/column-tree-menu/number-menu-items/number-menu-items.tsx:30— 5 duplicated blocks under web-console/src/views/workbench-view/column-tree/column-tree-menu/ have copies in at least two of the sibling directories complex-menu-items, number-menu-items, string-menu-items, time-menu-items — 4 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (138 matched lines × 2 locations) · ×1
Duplicated block with local edits (138 matched lines × 2 locations) web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:39— web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:39 · web-console/src/views/workbench-view/recent-query-task-panel/recent-query-task-panel.tsx:55 — the two spans are one implementation copied and then locally edited — 692 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (125 matched lines × 2 locations) · ×1
Duplicated block with local edits (125 matched lines × 2 locations) web-console/src/views/explore-view/components/resource-pane/column-dialog/column-dialog.tsx:35— web-console/src/views/explore-view/components/resource-pane/column-dialog/column-dialog.tsx:35 · web-console/src/views/explore-view/components/resource-pane/measure-dialog/measure-dialog.tsx:33 — the two spans are one implementation copied and then locally edited — 691 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (104 lines × 2 locations) web-console/src/dialogs/coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog.tsx:41— web-console/src/dialogs/coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog.tsx:41 · web-console/src/dialogs/overlord-dynamic-config-dialog/overlord-dynamic-config-dialog.tsx:41 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication· Duplicated block with local edits (100 matched lines × 2 locations) · ×1
Duplicated block with local edits (100 matched lines × 2 locations) web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:101— web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:101 · web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:428 — the two spans are one implementation copied and then locally edited — 452 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (99 lines × 2 locations) web-console/src/dialogs/broker-dynamic-config-dialog/broker-dynamic-config-dialog.tsx:37— web-console/src/dialogs/broker-dynamic-config-dialog/broker-dynamic-config-dialog.tsx:37 · web-console/src/dialogs/overlord-dynamic-config-dialog/overlord-dynamic-config-dialog.tsx:37 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication· Duplicated block with local edits (89 matched lines × 2 locations) · ×1
Duplicated block with local edits (89 matched lines × 2 locations) web-console/src/views/workbench-view/column-tree/column-tree-menu/number-menu-items/number-menu-items.tsx:30— web-console/src/views/workbench-view/column-tree/column-tree-menu/number-menu-items/number-menu-items.tsx:30 · web-console/src/views/workbench-view/column-tree/column-tree-menu/time-menu-items/time-menu-items.tsx:56 — the two spans are one implementation copied and then locally edited — 498 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (79 matched lines × 2 locations) · ×1
Duplicated block with local edits (79 matched lines × 2 locations) web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:103— web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:103 · web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:77 — the two spans are one implementation copied and then locally edited — 424 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (66 matched lines × 2 locations) · ×1
Duplicated block with local edits (66 matched lines × 2 locations) web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:186— web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:186 · web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:188 — the two spans are one implementation copied and then locally edited — 324 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (64 matched lines × 2 locations) · ×1
Duplicated block with local edits (64 matched lines × 2 locations) web-console/src/views/load-data-view/filter-table/filter-table.tsx:38— web-console/src/views/load-data-view/filter-table/filter-table.tsx:38 · web-console/src/views/load-data-view/transform-table/transform-table.tsx:39 — the two spans are one implementation copied and then locally edited — 408 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (56 matched lines × 2 locations) · ×1
Duplicated block with local edits (56 matched lines × 2 locations) web-console/src/views/load-data-view/load-data-view.tsx:1811— web-console/src/views/load-data-view/load-data-view.tsx:1811 · web-console/src/views/load-data-view/load-data-view.tsx:2000 — the two spans are one implementation copied and then locally edited — 298 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (51 matched lines × 2 locations) · ×1
Duplicated block with local edits (51 matched lines × 2 locations) web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:196— web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:196 · web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:199 — the two spans are one implementation copied and then locally edited — 255 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (45 matched lines × 2 locations) · ×1
Duplicated block with local edits (45 matched lines × 2 locations) web-console/src/dialogs/supervisor-table-action-dialog/supervisor-table-action-dialog.tsx:38— web-console/src/dialogs/supervisor-table-action-dialog/supervisor-table-action-dialog.tsx:38 · web-console/src/dialogs/task-table-action-dialog/task-table-action-dialog.tsx:34 — the two spans are one implementation copied and then locally edited — 231 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (43 lines × 2 locations) web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:390— web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:390 · web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:643 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (37 lines × 2 locations) web-console/src/views/explore-view/components/filter-pane/filter-menu/contains-filter-control/contains-filter-control.tsx:31— web-console/src/views/explore-view/components/filter-pane/filter-menu/contains-filter-control/contains-filter-control.tsx:31 · REDACTED:40 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (35 lines × 3 locations) web-console/src/druid-models/input-source/input-source.tsx:320— web-console/src/druid-models/input-source/input-source.tsx:320 · web-console/src/druid-models/input-source/input-source.tsx:382 · web-console/src/druid-models/input-source/input-source.tsx:456 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (32 lines × 2 locations) web-console/src/views/explore-view/utils/table-query.ts:565— web-console/src/views/explore-view/utils/table-query.ts:565 · web-console/src/views/explore-view/utils/table-query.ts:825 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (31 lines × 2 locations) web-console/src/components/record-table-pane/record-table-pane.tsx:149— web-console/src/components/record-table-pane/record-table-pane.tsx:149 · web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:709 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (31 lines × 3 locations) web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:280— web-console/src/views/explore-view/modules/bar-chart-module/bar-chart-module.tsx:280 · web-console/src/views/explore-view/modules/multi-axis-chart-module/multi-axis-chart-module.tsx:333 · web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:304 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (24 lines × 2 locations) web-console/src/views/datasources-view/datasources-view.tsx:1396— web-console/src/views/datasources-view/datasources-view.tsx:1396 · web-console/src/views/datasources-view/datasources-view.tsx:1428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 3 locations) web-console/src/views/supervisors-view/supervisors-view.tsx:1265— web-console/src/views/supervisors-view/supervisors-view.tsx:1265 · web-console/src/views/supervisors-view/supervisors-view.tsx:1291 · web-console/src/views/supervisors-view/supervisors-view.tsx:1317 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function SchemaStep (cyclomatic 67, cognitive 52) web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:265— SchemaStep has cyclomatic complexity 67 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function convertSpecToSql (cyclomatic 50, cognitive 62) web-console/src/helpers/spec-conversion.ts:82— convertSpecToSql has cyclomatic complexity 50 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function RunPanel (cyclomatic 41, cognitive 40) web-console/src/views/workbench-view/run-panel/run-panel.tsx:184— RunPanel has cyclomatic complexity 41 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getHeaderMenu (cyclomatic 35, cognitive 86) web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:167— getHeaderMenu has cyclomatic complexity 35 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getApiQuery (cyclomatic 35, cognitive 51) web-console/src/druid-models/workbench-query/workbench-query.ts:503— getApiQuery has cyclomatic complexity 35 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SegmentBarChartRender (cyclomatic 30, cognitive 36) web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:201— SegmentBarChartRender has cyclomatic complexity 30 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function run (cyclomatic 27, cognitive 48) · ×1
Complex function run (cyclomatic 27, cognitive 48) web-console/src/utils/query-manager/query-manager.ts:125— run has cyclomatic complexity 27 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function renderContent (cyclomatic 27, cognitive 26) web-console/src/views/workbench-view/execution-details-pane/execution-details-pane.tsx:59— renderContent has cyclomatic complexity 27 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getSqlCompletions (cyclomatic 26, cognitive 28) web-console/src/editor-completions/sql-completions.ts:236— getSqlCompletions has cyclomatic complexity 26 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ContinuousChartRender (cyclomatic 25, cognitive 31) web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx:150— ContinuousChartRender has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getByPartitionCountersForStage (cyclomatic 24, cognitive 31) web-console/src/druid-models/stages/stages.ts:745— getByPartitionCountersForStage has cyclomatic complexity 24 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fitIngestQueryPattern (cyclomatic 24, cognitive 30) web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts:140— fitIngestQueryPattern has cyclomatic complexity 24 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ConsoleTable (cyclomatic 24, cognitive 23) web-console/src/components/console-table/console-table.tsx:347— ConsoleTable has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SegmentTimeline (cyclomatic 24, cognitive 22) web-console/src/components/segment-timeline/segment-timeline.tsx:81— SegmentTimeline has cyclomatic complexity 24 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function DetailCell (cyclomatic 23, cognitive 36) web-console/src/views/services-view/services-view.tsx:254— DetailCell has cyclomatic complexity 23 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ColumnEditor (cyclomatic 23, cognitive 32) web-console/src/views/sql-data-loader-view/column-editor/column-editor.tsx:129— ColumnEditor has cyclomatic complexity 23 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function issueWithInputSource (cyclomatic 23, cognitive 22) web-console/src/druid-models/input-source/input-source.tsx:142— issueWithInputSource has cyclomatic complexity 23 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function FilterMenu (cyclomatic 23, cognitive 14) web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:120— FilterMenu has cyclomatic complexity 23 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ExpressionEditor (cyclomatic 22, cognitive 47) web-console/src/views/sql-data-loader-view/column-actions/column-actions.tsx:39— ExpressionEditor has cyclomatic complexity 22 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function summarizeInputSource (cyclomatic 22, cognitive 30) web-console/src/druid-models/external-config/external-config.ts:55— summarizeInputSource has cyclomatic complexity 22 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ExploreView (cyclomatic 22, cognitive 19) web-console/src/views/explore-view/explore-view.tsx:114— ExploreView has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function InputFormatStep (cyclomatic 22, cognitive 19) web-console/src/views/workbench-view/input-format-step/input-format-step.tsx:92— InputFormatStep has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function MeasureMenu (cyclomatic 21, cognitive 19) web-console/src/views/explore-view/components/control-pane/measure-menu.tsx:56— MeasureMenu has cyclomatic complexity 21 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function guessDataSourceNameFromInputSource (cyclomatic 20, cognitive 16) web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:1631— guessDataSourceNameFromInputSource has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getTaskExecution (cyclomatic 19, cognitive 31) web-console/src/helpers/execution/sql-task-execution.ts:161— getTaskExecution has cyclomatic complexity 19 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 19, cognitive 19) web-console/src/editor-languages/hjson-tokens.ts:142— (anonymous) has cyclomatic complexity 19 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function renderOptionsPropInput (cyclomatic 19, cognitive 15) web-console/src/views/explore-view/components/control-pane/control-pane.tsx:81— renderOptionsPropInput has cyclomatic complexity 19 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 18, cognitive 36) web-console/src/views/explore-view/utils/time-manipulation.ts:117— (anonymous) has cyclomatic complexity 18 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getRangeInExpression (cyclomatic 18, cognitive 35) web-console/src/views/explore-view/modules/time-chart-module/time-chart-module.tsx:60— getRangeInExpression has cyclomatic complexity 18 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function CellFilterMenu (cyclomatic 18, cognitive 25) web-console/src/components/cell-filter-menu/cell-filter-menu.tsx:88— CellFilterMenu has cyclomatic complexity 18 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function issueWithIoConfig (cyclomatic 18, cognitive 21) web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:1350— issueWithIoConfig has cyclomatic complexity 18 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseIsoDate (cyclomatic 18, cognitive 17) web-console/src/utils/date.ts:134— parseIsoDate has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function QueryTab (cyclomatic 18, cognitive 17) web-console/src/views/workbench-view/query-tab/query-tab.tsx:108— QueryTab has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function processQuery (cyclomatic 17, cognitive 36) web-console/src/views/segments-view/segments-view.tsx:309— processQuery has cyclomatic complexity 17 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 17, cognitive 24) web-console/src/views/load-data-view/schema-table/schema-table.tsx:82— (anonymous) has cyclomatic complexity 17 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function HeaderBar (cyclomatic 17, cognitive 16) web-console/src/components/header-bar/header-bar.tsx:72— HeaderBar has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function QueryErrorPane (cyclomatic 17, cognitive 14) web-console/src/components/query-error-pane/query-error-pane.tsx:34— QueryErrorPane has cyclomatic complexity 17 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ContinuousChartSingleRender (cyclomatic 17, cognitive 14) web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-single-render.tsx:70— ContinuousChartSingleRender has cyclomatic complexity 17 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 16, cognitive 33) web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:388— (anonymous) has cyclomatic complexity 16 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleSubmit (cyclomatic 16, cognitive 33) web-console/src/views/workbench-view/execution-submit-dialog/execution-submit-dialog.tsx:59— handleSubmit has cyclomatic complexity 16 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· web-console/src/views/load-data-view/load-data-view.tsx · ×1
web-console/src/views/load-data-view/load-data-view.tsx: 3519 lines of code web-console/src/views/load-data-view/load-data-view.tsx:1— web-console/src/views/load-data-view/load-data-view.tsx has 3519 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx · ×1
web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx: 2664 lines of code web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:1— web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx has 2664 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/datasources-view/datasources-view.tsx · ×1
web-console/src/views/datasources-view/datasources-view.tsx: 1750 lines of code web-console/src/views/datasources-view/datasources-view.tsx:1— web-console/src/views/datasources-view/datasources-view.tsx has 1750 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/supervisors-view/supervisors-view.tsx · ×1
web-console/src/views/supervisors-view/supervisors-view.tsx: 1331 lines of code web-console/src/views/supervisors-view/supervisors-view.tsx:1— web-console/src/views/supervisors-view/supervisors-view.tsx has 1331 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/services-view/services-view.tsx · ×1
web-console/src/views/services-view/services-view.tsx: 1246 lines of code web-console/src/views/services-view/services-view.tsx:1— web-console/src/views/services-view/services-view.tsx has 1246 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/segments-view/segments-view.tsx · ×1
web-console/src/views/segments-view/segments-view.tsx: 1152 lines of code web-console/src/views/segments-view/segments-view.tsx:1— web-console/src/views/segments-view/segments-view.tsx has 1152 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx · ×1
web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx: 1046 lines of code web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx:1— web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx has 1046 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx · ×1
web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx: 1027 lines of code web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx:1— web-console/src/views/sql-data-loader-view/schema-step/schema-step.tsx has 1027 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/native-json-query/native-json-query-completions.ts · ×1
web-console/src/druid-models/native-json-query/native-json-query-completions.ts: 1023 lines of code web-console/src/druid-models/native-json-query/native-json-query-completions.ts:1— web-console/src/druid-models/native-json-query/native-json-query-completions.ts has 1023 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/workbench-view/workbench-view.tsx · ×1
web-console/src/views/workbench-view/workbench-view.tsx: 968 lines of code web-console/src/views/workbench-view/workbench-view.tsx:1— web-console/src/views/workbench-view/workbench-view.tsx has 968 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/load-data-view/ingestion-spec-completions.ts · ×1
web-console/src/views/load-data-view/ingestion-spec-completions.ts: 908 lines of code web-console/src/views/load-data-view/ingestion-spec-completions.ts:1— web-console/src/views/load-data-view/ingestion-spec-completions.ts has 908 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/explore-view/utils/table-query.ts · ×1
web-console/src/views/explore-view/utils/table-query.ts: 841 lines of code web-console/src/views/explore-view/utils/table-query.ts:1— web-console/src/views/explore-view/utils/table-query.ts has 841 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/components/console-table/console-table.tsx · ×1
web-console/src/components/console-table/console-table.tsx: 778 lines of code web-console/src/components/console-table/console-table.tsx:1— web-console/src/components/console-table/console-table.tsx has 778 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/stages/stages.ts · ×1
web-console/src/druid-models/stages/stages.ts: 740 lines of code web-console/src/druid-models/stages/stages.ts:1— web-console/src/druid-models/stages/stages.ts has 740 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/components/segment-timeline/segment-bar-chart-render.tsx · ×1
web-console/src/components/segment-timeline/segment-bar-chart-render.tsx: 714 lines of code web-console/src/components/segment-timeline/segment-bar-chart-render.tsx:1— web-console/src/components/segment-timeline/segment-bar-chart-render.tsx has 714 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx · ×1
web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx: 714 lines of code web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx:1— web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx has 714 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/tasks-view/tasks-view.tsx · ×1
web-console/src/views/tasks-view/tasks-view.tsx: 684 lines of code web-console/src/views/tasks-view/tasks-view.tsx:1— web-console/src/views/tasks-view/tasks-view.tsx has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/workbench-view/run-panel/run-panel.tsx · ×1
web-console/src/views/workbench-view/run-panel/run-panel.tsx: 684 lines of code web-console/src/views/workbench-view/run-panel/run-panel.tsx:1— web-console/src/views/workbench-view/run-panel/run-panel.tsx has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/workbench-view/column-tree/column-tree.tsx · ×1
web-console/src/views/workbench-view/column-tree/column-tree.tsx: 682 lines of code web-console/src/views/workbench-view/column-tree/column-tree.tsx:1— web-console/src/views/workbench-view/column-tree/column-tree.tsx has 682 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/utils/general.tsx · ×1
web-console/src/utils/general.tsx: 663 lines of code web-console/src/utils/general.tsx:1— web-console/src/utils/general.tsx has 663 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/input-source/input-source.tsx · ×1
web-console/src/druid-models/input-source/input-source.tsx: 657 lines of code web-console/src/druid-models/input-source/input-source.tsx:1— web-console/src/druid-models/input-source/input-source.tsx has 657 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/input-format/input-format.tsx · ×1
web-console/src/druid-models/input-format/input-format.tsx: 646 lines of code web-console/src/druid-models/input-format/input-format.tsx:1— web-console/src/druid-models/input-format/input-format.tsx has 646 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/utils/sampler.ts · ×1
web-console/src/utils/sampler.ts: 639 lines of code web-console/src/utils/sampler.ts:1— web-console/src/utils/sampler.ts has 639 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx · ×1
web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx: 589 lines of code web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx:1— web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx has 589 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/workbench-view/query-tab/query-tab.tsx · ×1
web-console/src/views/workbench-view/query-tab/query-tab.tsx: 585 lines of code web-console/src/views/workbench-view/query-tab/query-tab.tsx:1— web-console/src/views/workbench-view/query-tab/query-tab.tsx has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/lookup-spec/lookup-spec.tsx · ×1
web-console/src/druid-models/lookup-spec/lookup-spec.tsx: 576 lines of code web-console/src/druid-models/lookup-spec/lookup-spec.tsx:1— web-console/src/druid-models/lookup-spec/lookup-spec.tsx has 576 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/execution/execution.ts · ×1
web-console/src/druid-models/execution/execution.ts: 565 lines of code web-console/src/druid-models/execution/execution.ts:1— web-console/src/druid-models/execution/execution.ts has 565 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/workbench-query/workbench-query.ts · ×1
web-console/src/druid-models/workbench-query/workbench-query.ts: 561 lines of code web-console/src/druid-models/workbench-query/workbench-query.ts:1— web-console/src/druid-models/workbench-query/workbench-query.ts has 561 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/components/auto-form/auto-form.tsx · ×1
web-console/src/components/auto-form/auto-form.tsx: 535 lines of code web-console/src/components/auto-form/auto-form.tsx:1— web-console/src/components/auto-form/auto-form.tsx has 535 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/lookups-view/lookups-view.tsx · ×1
web-console/src/views/lookups-view/lookups-view.tsx: 506 lines of code web-console/src/views/lookups-view/lookups-view.tsx:1— web-console/src/views/lookups-view/lookups-view.tsx has 506 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/explore-view/explore-view.tsx · ×1
web-console/src/views/explore-view/explore-view.tsx: 497 lines of code web-console/src/views/explore-view/explore-view.tsx:1— web-console/src/views/explore-view/explore-view.tsx has 497 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx · ×1
web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx: 464 lines of code web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx:1— web-console/src/views/explore-view/components/generic-output-table/generic-output-table.tsx has 464 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/console-application.tsx · ×1
web-console/src/console-application.tsx: 454 lines of code web-console/src/console-application.tsx:1— web-console/src/console-application.tsx has 454 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/components/header-bar/header-bar.tsx · ×1
web-console/src/components/header-bar/header-bar.tsx: 451 lines of code web-console/src/components/header-bar/header-bar.tsx:1— web-console/src/components/header-bar/header-bar.tsx has 451 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/druid-models/metric-spec/metric-spec.tsx · ×1
web-console/src/druid-models/metric-spec/metric-spec.tsx: 451 lines of code web-console/src/druid-models/metric-spec/metric-spec.tsx:1— web-console/src/druid-models/metric-spec/metric-spec.tsx has 451 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/helpers/spec-conversion.ts · ×1
web-console/src/helpers/spec-conversion.ts: 447 lines of code web-console/src/helpers/spec-conversion.ts:1— web-console/src/helpers/spec-conversion.ts has 447 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx · ×1
web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx: 432 lines of code web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx:1— web-console/src/views/explore-view/components/filter-pane/filter-menu/filter-menu.tsx has 432 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web-console/src/editor-completions/sql-completions.ts · ×1
web-console/src/editor-completions/sql-completions.ts: 428 lines of code web-console/src/editor-completions/sql-completions.ts:1— web-console/src/editor-completions/sql-completions.ts has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~183 LoC) web-console/src/editor-languages/hjson-tokens.ts— no import path from any entry point (73 application, 10 tooling, 214 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~62 LoC) web-console/src/views/workbench-view/execution-stages-pane-loader/execution-stages-pane-loader.tsx— no import path from any entry point (73 application, 10 tooling, 214 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~52 LoC) web-console/src/druid-models/dart/dart-query-entry.mock.ts— no import path from any entry point (73 application, 10 tooling, 214 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency 'ajv' — Declared in web-console/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X2 · Cancellation propagation· Async function without AbortSignal · ×1
Async function without AbortSignal: processQuery web-console/src/views/explore-view/modules/pie-chart-module/pie-chart-module.tsx:138— `processQuery` holds an AbortSignal but calls `runSqlQuery(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `runSqlQuery(…, { signal })`.
X27 · Collection changed while being enumerated· Collection is structurally changed while it is being enumerated · ×1
Collection is structurally changed while it is being enumerated processing/src/main/java/org/apache/druid/query/metadata/metadata/ListColumnIncluderator.java:68— `this.columns` is enumerated directly, and line 70 calls `this.columns.add(…)` inside the loop body — a structural change to a `TreeSet`. The loop's hidden iterator is fail-fast, so its next `next()` throws `ConcurrentModificationException`: every pass that reaches this call ends the loop by exception instead of by running out of elements, and the remaining elements are never seen.
No direct assertions: testInvokeSegmentSchemaAnnounced sql/src/test/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheTest.java:1333— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testCastAsDate sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2366— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testCastAsTimestamp sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2298— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testCastFromDate sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2414— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testCastFromTimestamp sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2332— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testCeil sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1153— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testCharacterLength sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:199— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testConcat sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:184— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testContains sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1545— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testContainsAsFilter sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1741— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testDateTrunc sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1458— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testExtract sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2262— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testFloor sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1121— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testHumanReadableBinaryByteFormat sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2804— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testHumanReadableDecimalByteFormat sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2906— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testLeft sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2572— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testOperatorConversionsDruidBinaryLongFn sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2755— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testOperatorConversionsDruidUnaryDoubleFn sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2709— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testOperatorConversionsDruidUnaryLongFn sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:2678— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testOtherTimeCeil sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1958— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testOtherTimeFloor sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1895— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testPad sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1519— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testParseLong sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:978— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testPosition sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1034— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testPower sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java:1107— No conventional assertion call was detected, and 2438 of 3469 tests in `druid-sql` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
Orphaned file extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/guice/ExtensionsLoader.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/CacheScheduler.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/segment/data/GenericIndexedWriter.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/segment/join/filter/JoinFilterCorrelations.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file extensions-core/s3-extensions/src/main/java/com/fasterxml/jackson/databind/PropertyNamingStrategies.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file server/src/main/java/org/apache/druid/server/coordinator/balancer/SegmentsCostCache.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/segment/data/CompressionFactory.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/timeline/SegmentId.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/java/util/metrics/OshiSysMonitor.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/query/monomorphicprocessing/SpecializationService.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexPhaseRunner.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/segment/DimensionIndexer.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeDiscoveryProvider.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferMinMaxOffsetHeap.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file server/src/main/java/org/apache/druid/segment/metadata/SegmentSchemaManager.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/MultipleKubernetesTaskRunner.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/query/ordering/StringComparators.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/collections/StupidPool.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimal.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/RabbitStreamRecordSupplier.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file server/src/main/java/org/apache/druid/client/indexing/ClientCompactionTaskQueryTuningConfig.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GrouperBufferComparatorUtils.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Duplicated predicate sql/src/main/java/org/apache/druid/sql/calcite/planner/CatalogDdlHandler.java:330— `!(node instanceof SqlIdentifier) || !((SqlIdentifier) node).isSimple()` appears character-identically in 2 files — sql/src/main/java/org/apache/druid/sql/calcite/planner/CatalogDdlHandler.java, sql/src/main/java/org/apache/druid/sql/calcite/planner/ProjectionSpecTranslator.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/query/CursorGranularizer.java:58— `!Granularities.ALL.equals(granularity) && timeOrder == Order.NONE` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/query/CursorGranularizer.java, processing/src/main/java/org/apache/druid/query/vector/VectorCursorGranularizer.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java:272— `!Objects.equals(getDimension(), dimension) || getExtractionFn() != null` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java, processing/src/main/java/org/apache/druid/query/filter/SelectorDimFilter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/HiveIcebergCatalog.java:113— `!Strings.isNullOrEmpty(principal) && !Strings.isNullOrEmpty(keytab)` appears character-identically in 2 files — extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/HiveIcebergCatalog.java, extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageAuthentication.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java:1093— `!Thread.interrupted() && lifecycleLock.awaitStarted(1, TimeUnit.MILLISECONDS)` appears character-identically in 2 files — indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java, server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/frame/segment/FrameFilteredOffset.java:59— `!baseOffset.withinBounds() || filterMatcher.matches(false)` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/frame/segment/FrameFilteredOffset.java, processing/src/main/java/org/apache/druid/segment/FilteredOffset.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessor.java:490— `!channel.isFinished() && !channel.canRead()` appears character-identically in 2 files — multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessor.java, processing/src/main/java/org/apache/druid/frame/processor/FrameProcessorExecutor.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java:121— `!headMap.isEmpty() && key.startsWith(headMap.lastKey())` appears character-identically in 2 files — extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverter.java, extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/segment/RowBasedCursor.java:128— `!isDone() && !valueMatcher.matches(false)` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/segment/RowBasedCursor.java, processing/src/main/java/org/apache/druid/segment/join/PostJoinCursor.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdSupportedBinaryOp.java:88— `!mathLib || ExpressionProcessing.useVectorMathApi()` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdSupportedBinaryOp.java, processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdSupportedUnaryOp.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/segment/CursorHolder.java:126— `!ordering.isEmpty() && ColumnHolder.TIME_COLUMN_NAME.equals(ordering.get(0).getColumnName())` appears character-identically in 3 files — processing/src/main/java/org/apache/druid/segment/CursorHolder.java, processing/src/main/java/org/apache/druid/segment/Cursors.java, processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndexCursorHolder.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:169— `!otherContainsThis && !otherContainsThisMultiTopic && !otherContainsThisSingleTopic` appears character-identically in 2 files — extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java, extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:57— `!partitionSequenceNumberMap.isEmpty() && partitionSequenceNumberMap.keySet() .stream() .findFirst() .get() .isMultiTopicPartition()` appears character-identically in 2 files — extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java, extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java:79— `!this.isMultiTopicPartition() && !that.isMultiTopicPartition()` appears character-identically in 2 files — extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamEndSequenceNumbers.java, extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaSeekableStreamStartSequenceNumbers.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate server/src/main/java/org/apache/druid/client/DirectDruidClient.java:259— `!usingBackpressure || currentQueuedByteCount < maxQueuedBytes` appears character-identically in 2 files — server/src/main/java/org/apache/druid/client/DirectDruidClient.java, server/src/main/java/org/apache/druid/discovery/DataServerResponseHandler.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java:109— `"bucket".equals(input) || "key".equals(input)` appears character-identically in 2 files — extensions-contrib/aliyun-oss-extensions/src/main/java/org/apache/druid/storage/aliyun/OssDataSegmentMover.java, extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentMover.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:675— `((lowerComparing > 0)) && (upperComparing > 0)` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java, processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java:195— `(dataSourceFromQuery instanceof QueryDataSource) && !toolChest.canPerformSubquery(((QueryDataSource) dataSourceFromQuery).getQuery())` appears character-identically in 2 files — server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java, server/src/main/java/org/apache/druid/server/ServerManager.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/math/expr/vector/DoubleBivariateFunctionVectorProcessor.java:69— `(hasLeftNulls && leftNulls[i]) || (hasRightNulls && rightNulls[i])` appears character-identically in 17 files — processing/src/main/java/org/apache/druid/math/expr/vector/DoubleBivariateFunctionVectorProcessor.java, processing/src/main/java/org/apache/druid/math/expr/vector/LongBivariateFunctionVectorProcessor.java, processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleAddProcessor.java, processing/src/main/java/org/apache/druid/math/expr/vector/simd/SimdDoubleDoubleDivProcessor.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/segment/BaseSingleValueDimensionSelector.java:66— `(includeUnknown && rowValue == null) || Objects.equals(rowValue, value)` appears character-identically in 3 files — processing/src/main/java/org/apache/druid/segment/BaseSingleValueDimensionSelector.java, processing/src/main/java/org/apache/druid/segment/DimensionSelectorUtils.java, processing/src/main/java/org/apache/druid/segment/virtual/ExpressionMultiValueDimensionSelector.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:688— `(lowerComparing > 0) && (upperComparing >= 0)` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java, processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:701— `(lowerComparing >= 0) && (upperComparing > 0)` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java, processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:714— `(lowerComparing >= 0) && (upperComparing >= 0)` appears character-identically in 2 files — processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java, processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilePostAggregator.java:142— `Double.compare(that.fraction, fraction) == 0 && Objects.equals(name, that.name) && Objects.equals(field, that.field)` appears character-identically in 2 files — extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchToQuantilePostAggregator.java, extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/TDigestSketchToQuantilePostAggregator.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilePostAggregator.java:134— `Double.compare(that.fraction, fraction) == 0 && name.equals(that.name) && field.equals(that.field)` appears character-identically in 3 files — extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchToQuantilePostAggregator.java, extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToQuantilePostAggregator.java, extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilePostAggregator.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Fat interface: TaskRunner (16 abstract methods) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunner.java:44— `TaskRunner` declares 16 abstract methods: `getBlacklistedTaskSlotCount`, `getIdleTaskSlotCount`, `getKnownTasks`, `getLazyTaskSlotCount`, `getPendingTasks`, `getRunningTasks`, `getScalingStats`, `getTotalTaskSlotCount`, `getUsedTaskSlotCount`, `registerListener`, `restore`, `run`, `shutdown`, `start`, `stop`, `unregisterListener`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: TaskStorage (16 abstract methods) indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskStorage.java:37— `TaskStorage` declares 16 abstract methods: `addLock`, `getActiveTaskInfos`, `getActiveTasks`, `getActiveTasksByDatasource`, `getCompletedTasksInfo`, `getLocks`, `getStatus`, `getTask`, `getTaskInfo`, `getTaskInfos`, `getTaskStatusPlusList`, `insert`, `removeLock`, `removeTasksOlderThan`, `replaceLock`, `setStatus`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: FrameContext (20 abstract methods) multi-stage-query/src/main/java/org/apache/druid/msq/exec/FrameContext.java:46— `FrameContext` declares 20 abstract methods: `acquireProcessingBuffers`, `close`, `coordinatorClient`, `dataServerQueryHandlerFactory`, `frameWriterSpec`, `indexIO`, `indexMerger`, `jsonMapper`, `memoryParameters`, `persistDir`, `policyEnforcer`, `processingBuffers`, `rowIngestionMeters`, `segmentManager`, `segmentPusher`, `segmentWrangler`, `storageParameters`, `tempDir`, `virtualStorageManager`, `wireTransferableContext`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: WorkerContext (17 abstract methods) multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerContext.java:44— `WorkerContext` declares 17 abstract methods: `close`, `emitMetric`, `frameContext`, `includeAllCounters`, `injector`, `isDebug`, `jsonMapper`, `makeControllerClient`, `makeWorkerClient`, `maxConcurrentStages`, `policyEnforcer`, `queryId`, `registerWorker`, `selfNode`, `tempDir`, `threadCount`, `workerId`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: Query<T> (18 abstract methods) processing/src/main/java/org/apache/druid/query/Query.java:76— `Query<T>` declares 18 abstract methods: `getContext`, `getDataSource`, `getDuration`, `getFilter`, `getGranularity`, `getId`, `getIntervals`, `getResultOrdering`, `getRunner`, `getSubQueryId`, `getTimezone`, `getType`, `hasFilters`, `withDataSource`, `withId`, `withOverriddenContext`, `withQuerySegmentSpec`, `withSubQueryId`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: QueryMetrics<QueryType> (55 abstract methods) processing/src/main/java/org/apache/druid/query/QueryMetrics.java:162— `QueryMetrics<QueryType>` declares 55 abstract methods: `context`, `dataSource`, `duration`, `emit`, `hasFilters`, `identity`, `interval`, `makeBitmapResultFactory`, `parallelMergeParallelism`, `projection`, `query`, `queryId`, `queryId`, `queryType`, `remoteAddress`, `reportBackPressureTime`, `reportBitmapConstructionTime`, `reportCpuTime`, `reportNodeBytes`, `reportNodeTime`, `reportNodeTimeToFirstByte`, `reportParallelMergeFastestPartitionTime`, `reportParallelMergeInputRows`, `reportParallelMergeInputSequences`, `reportParallelMergeOutputRows`, `reportParallelMergeParallelism`, `reportParallelMergeSlowestPartitionTime`, `reportParallelMergeTaskCount`, `reportParallelMergeTotalCpuTime`, `reportParallelMergeTotalTime`, `reportPreFilteredRows`, `reportQueriedSegmentCount`, `reportQueryBytes`, `reportQueryTime`, `reportResultCachePoll`, `reportSegmentAndCacheTime`, `reportSegmentOnDemandLoadBytes`, `reportSegmentOnDemandLoadCount`, `reportSegmentOnDemandLoadTime`, `reportSegmentOnDemandLoadTimeAvg`, and 15 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 55 declarations carry 53 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 53 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IncrementalIndexRowSelector (17 abstract methods) processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndexRowSelector.java:32— `IncrementalIndexRowSelector` declares 17 abstract methods: `getColumnFormat`, `getDimension`, `getDimensionNames`, `getDimensions`, `getFacts`, `getLastRowIndex`, `getMetric`, `getMetricDoubleValue`, `getMetricFloatValue`, `getMetricLongValue`, `getMetricNames`, `getMetricObjectValue`, `getOrdering`, `getTimePosition`, `isEmpty`, `isNull`, `numRows`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: DimensionIndexer<EncodedType, EncodedKeyComponentType, ActualType> (16 abstract methods) processing/src/main/java/org/apache/druid/segment/DimensionIndexer.java:112— `DimensionIndexer<EncodedType, EncodedKeyComponentType, ActualType>` declares 16 abstract methods: `checkUnsortedEncodedKeyComponentsEqual`, `compareUnsortedEncodedKeyComponents`, `convertUnsortedEncodedKeyComponentToActualList`, `convertUnsortedValuesToSorted`, `fillBitmapsFromUnsortedEncodedKeyComponent`, `getCardinality`, `getColumnCapabilities`, `getMaxValue`, `getMinValue`, `getSortedIndexedValues`, `getUnsortedEncodedKeyComponentHashCode`, `getUnsortedEncodedValueFromSorted`, `makeColumnValueSelector`, `makeDimensionSelector`, `processRowValsToUnsortedEncodedKeyComponent`, `setSparseIndexed`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: DataSourceCompactionConfig (18 abstract methods) server/src/main/java/org/apache/druid/server/coordinator/DataSourceCompactionConfig.java:53— `DataSourceCompactionConfig` declares 18 abstract methods: `getBaseTable`, `getDataSource`, `getDimensionsSpec`, `getEngine`, `getGranularitySpec`, `getInputSegmentSizeBytes`, `getIoConfig`, `getMaxRowsPerSegment`, `getMetricsSpec`, `getProjections`, `getSegmentGranularity`, `getSkipIntervals`, `getSkipOffsetFromLatest`, `getTaskContext`, `getTaskPriority`, `getTransformSpec`, `getTuningConfig`, `validate`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IndexerMetadataStorageCoordinator (45 abstract methods) server/src/main/java/org/apache/druid/indexing/overlord/IndexerMetadataStorageCoordinator.java:49— `IndexerMetadataStorageCoordinator` declares 45 abstract methods: `allocatePendingSegment`, `allocatePendingSegments`, `commitAppendSegments`, `commitAppendSegmentsAndMetadata`, `commitMetadataOnly`, `commitReplaceSegments`, `commitSegments`, `commitSegmentsAndMetadata`, `deleteDataSourceMetadata`, `deletePendingSegments`, `deletePendingSegmentsCreatedInInterval`, `deletePendingSegmentsForTaskAllocatorId`, `deleteSegments`, `deleteUpgradeSegmentsForTask`, `getPendingSegments`, `getSegmentTimelineForAllocation`, `getUnusedSegmentIntervals`, `insertDataSourceMetadata`, `insertIntoUpgradeSegmentsTable`, `iterateAllUnusedSegmentsForDatasource`, `markAllNonOvershadowedSegmentsAsUsed`, `markAllSegmentsAsUnused`, `markNonOvershadowedSegmentsAsUsed`, `markNonOvershadowedSegmentsAsUsed`, `markSegmentAsUnused`, `markSegmentAsUsed`, `markSegmentsAsUnused`, `markSegmentsWithinIntervalAsUnused`, `removeDataSourceMetadataOlderThan`, `resetDataSourceMetadata`, `retrieveAllDatasourceNames`, `retrieveAllUsedSegments`, `retrieveDataSourceMetadata`, `retrieveSegmentForId`, `retrieveSegmentsById`, `retrieveSomeUnusedSegmentIntervals`, `retrieveSomeUnusedSegmentIntervals`, `retrieveUnusedSegmentsForInterval`, `retrieveUnusedSegmentsWithExactInterval`, `retrieveUpgradedFromSegmentIds`, and 5 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 45 declarations carry 43 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 43 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: CoordinatorClient (18 abstract methods) server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClient.java:45— `CoordinatorClient` declares 18 abstract methods: `fetchAllUsedSegmentsWithOvershadowedStatus`, `fetchBootstrapSegments`, `fetchDataSourceInformation`, `fetchDataSourcesWithUsedSegments`, `fetchLookupsForTierSync`, `fetchSegment`, `fetchServerViewSegments`, `fetchUsedSegments`, `findCurrentLeader`, `getBrokerDynamicConfig`, `getCompactionSnapshots`, `getCoordinatorDynamicConfig`, `getRulesForAllDatasources`, `isHandoffComplete`, `updateAllLookups`, `updateCoordinatorDynamicConfig`, `updateRulesForDatasource`, `withRetryPolicy`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: DatasourceSegmentMetadataReader (16 abstract methods) server/src/main/java/org/apache/druid/metadata/segment/DatasourceSegmentMetadataReader.java:37— `DatasourceSegmentMetadataReader` declares 16 abstract methods: `findExistingSegmentIds`, `findHighestUnusedSegmentId`, `findPendingSegmentIds`, `findPendingSegmentIdsWithExactInterval`, `findPendingSegments`, `findPendingSegmentsOverlapping`, `findPendingSegmentsWithExactInterval`, `findSegment`, `findSegments`, `findSegmentsWithSchema`, `findUnusedSegments`, `findUsedSegment`, `findUsedSegmentIdsOverlapping`, `findUsedSegments`, `findUsedSegmentsOverlappingAnyOf`, `findUsedSegmentsPlusOverlappingAnyOf`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: SegmentCacheManager (16 abstract methods) server/src/main/java/org/apache/druid/segment/loading/SegmentCacheManager.java:38— `SegmentCacheManager` declares 16 abstract methods: `acquireCachedSegment`, `acquireSegment`, `bootstrap`, `canHandleSegments`, `canLoadSegmentOnDemand`, `canLoadSegmentsOnDemand`, `drop`, `getCachedSegments`, `getLoadingThreadPool`, `getLocations`, `getSegmentFiles`, `load`, `removeInfoFile`, `shutdown`, `shutdownBootstrap`, `storeInfoFile`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: VirtualStorageLocationStats (17 abstract methods) server/src/main/java/org/apache/druid/segment/loading/VirtualStorageLocationStats.java:22— `VirtualStorageLocationStats` declares 17 abstract methods: `getEvictionBytes`, `getEvictionCount`, `getHitBytes`, `getHitCount`, `getHoldBytes`, `getHoldCount`, `getInternalHoldBytes`, `getInternalHoldCount`, `getLoadBeginBytes`, `getLoadBeginCount`, `getLoadBytes`, `getLoadCount`, `getReadBytes`, `getReadCount`, `getReadTimeNanos`, `getRejectCount`, `getUsedBytes`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: OverlordClient (26 abstract methods) server/src/main/java/org/apache/druid/rpc/indexing/OverlordClient.java:62— `OverlordClient` declares 26 abstract methods: `cancelTask`, `findCurrentLeader`, `findLockedIntervals`, `getClusterCompactionConfig`, `getTotalWorkerCapacity`, `getWorkers`, `isCompactionSupervisorEnabled`, `killPendingSegments`, `markNonOvershadowedSegmentsAsUsed`, `markNonOvershadowedSegmentsAsUsed`, `markSegmentAsUnused`, `markSegmentAsUsed`, `markSegmentsAsUnused`, `markSegmentsAsUnused`, `postSupervisor`, `resetToLatestAndBackfill`, `runTask`, `supervisorStatuses`, `taskPayload`, `taskReportAsMap`, `taskStatus`, `taskStatuses`, `taskStatuses`, `terminateSupervisor`, `updateClusterCompactionConfig`, `withRetryPolicy`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 26 declarations carry 23 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 23 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: BasicAuthorizerMetadataStorageUpdater (18 abstract methods) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/updater/BasicAuthorizerMetadataStorageUpdater.java:36— `BasicAuthorizerMetadataStorageUpdater` declares 18 abstract methods: `assignGroupMappingRole`, `assignUserRole`, `createGroupMapping`, `createRole`, `createUser`, `deleteGroupMapping`, `deleteRole`, `deleteUser`, `getCachedGroupMappingMap`, `getCachedRoleMap`, `getCachedUserMap`, `getCurrentGroupMappingMapBytes`, `getCurrentRoleMapBytes`, `getCurrentUserMapBytes`, `refreshAllNotification`, `setPermissions`, `unassignGroupMappingRole`, `unassignUserRole`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: BasicAuthorizerResourceHandler (24 abstract methods) extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/endpoint/BasicAuthorizerResourceHandler.java:33— `BasicAuthorizerResourceHandler` declares 24 abstract methods: `assignRoleToGroupMapping`, `assignRoleToUser`, `authorizerGroupMappingUpdateListener`, `authorizerUserUpdateListener`, `createGroupMapping`, `createRole`, `createUser`, `deleteGroupMapping`, `deleteRole`, `deleteUser`, `getAllGroupMappings`, `getAllRoles`, `getAllUsers`, `getCachedGroupMappingMaps`, `getCachedUserMaps`, `getGroupMapping`, `getLoadStatus`, `getRole`, `getRolePermissions`, `getUser`, `refreshAll`, `setRolePermissions`, `unassignRoleFromGroupMapping`, `unassignRoleFromUser`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: KubernetesTaskRunnerConfig (25 abstract methods) extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunnerConfig.java:30— `KubernetesTaskRunnerConfig` declares 25 abstract methods: `getAdvertisedPlaintextPort`, `getAnnotations`, `getCapacity`, `getCpuCoreInMicro`, `getGraceTerminationPeriodSeconds`, `getJavaOptsArray`, `getK8sSharedInformerResyncPeriod`, `getK8sTaskPodNamePrefix`, `getKubexitImage`, `getLabels`, `getLogSaveTimeout`, `getNamespace`, `getOverlordNamespace`, `getPeonMonitors`, `getPrimaryContainerName`, `getTaskCleanupDelay`, `getTaskCleanupInterval`, `getTaskJoinTimeout`, `getTaskLaunchTimeout`, `getTaskTimeout`, `isAllowTaskPodTemplateSelection`, `isDebugJobs`, `isDisableClientProxy`, `isSidecarSupport`, `isUseK8sSharedInformers`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 46 significant file(s) lose their only recent owner: processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java, processing/src/main/java/org/apache/druid/segment/IndexMergerV10.java, services/src/main/java/org/apache/druid/cli/DumpSegment.java, server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java, processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java, processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java, processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java, processing/src/main/java/org/apache/druid/segment/projections/ClusteringColumnSelectorFactory.java (+38 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 34 significant file(s) lose their only recent owner: processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java, multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java, multi-stage-query/src/main/java/org/apache/druid/msq/exec/std/StandardShuffleOperations.java, processing/src/main/java/org/apache/druid/query/scan/ScanQueryRunnerFactory.java, processing/src/main/java/org/apache/druid/frame/processor/RunAllFullyWidget.java, multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/DartControllerRegistry.java, multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/MSQErrorReport.java, multi-stage-query/src/main/java/org/apache/druid/msq/kernel/QueryDefinition.java (+26 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 25 significant file(s) lose their only recent owner: web-console/src/views/datasources-view/datasources-view.tsx, web-console/src/views/workbench-view/column-tree/column-tree.tsx, web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx, web-console/src/components/segment-timeline/segment-bar-chart-render.tsx, web-console/src/views/workbench-view/query-tab/query-tab.tsx, web-console/src/views/tasks-view/tasks-view.tsx, web-console/src/utils/general.tsx, web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-render.tsx (+17 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 9 significant file(s) lose their only recent owner: extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java, processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java, extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java, processing/src/main/java/org/apache/druid/query/context/QueryContextParameter.java, extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/OffHeapNamespaceExtractionCacheManager.java, indexing-service/src/main/java/org/apache/druid/indexing/worker/executor/ExecutorLifecycle.java, processing/src/main/java/org/apache/druid/frame/channel/ReadableInputStreamFrameChannel.java, sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ScalarInArrayOperatorConversion.java (+1 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 7 significant file(s) lose their only recent owner: indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentAllocationQueue.java, indexing-service/src/main/java/org/apache/druid/indexing/overlord/duty/UnusedSegmentsKiller.java, indexing-service/src/main/java/org/apache/druid/indexing/scheduledbatch/ScheduledBatchTaskManager.java, indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskLocks.java, server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransactionFactory.java, indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskActionToolbox.java, server/src/main/java/org/apache/druid/metadata/UnusedSegmentKillerConfig.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 7 significant file(s) lose their only recent owner: processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregatorFactory.java, processing/src/main/java/org/apache/druid/segment/transform/Transformer.java, server/src/main/java/org/apache/druid/server/coordinator/balancer/DiskNormalizedCostBalancerStrategy.java, cloud/aws-common/src/main/java/org/apache/druid/common/aws/AWSClientUtil.java, processing/src/main/java/org/apache/druid/query/ForwardingQueryProcessingPool.java, processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanHolder.java, processing/src/main/java/org/apache/druid/query/aggregation/simd/SimdDoubleMeanVectorAggregator.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 7 significant file(s) lose their only recent owner: server/src/main/java/org/apache/druid/curator/announcement/PathChildrenAnnouncer.java, server/src/main/java/org/apache/druid/curator/announcement/NodeAnnouncer.java, extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufConverter.java, processing/src/main/java/org/apache/druid/guice/GuiceAnnotationIntrospector.java, extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/config/K8sNodeLabelDynamicConfigProvider.java, extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/config/ApiNodeLabelReader.java, extensions-core/kubernetes-extensions/src/main/java/org/apache/druid/k8s/discovery/K8sDiscoveryModule.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 3 significant file(s) lose their only recent owner: processing/src/main/java/org/apache/druid/query/ChainedExecutionQueryRunner.java, server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorStatus.java, services/src/main/java/org/apache/druid/guice/SegmentSchemaCacheModule.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 3 significant file(s) lose their only recent owner: multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerClient.java, extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CatalogUpdateReceiver.java, extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CacheNotifier.java. Pair on, review, or document these before any departure.
Silent fallback default on parse failure jdbc-driver/src/main/java/org/apache/druid/jdbc/DruidDatabaseMetaData.java:1620— `parseVersionPart` returns `0` when `NumberFormatException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure processing/src/main/java/org/apache/druid/timeline/SegmentId.java:191— `iteratePossibleParsingsWithDataSource` returns `Collections.emptyList()` when `IllegalArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:52— `getDouble` returns `0d` when `NumberFormatException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:70— `getFloat` returns `0f` when `NumberFormatException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:106— `getInt` returns `0` when `NumberFormatException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure processing/src/main/java/org/apache/druid/query/rowsandcols/column/accessor/ObjectColumnAccessorBase.java:88— `getLong` returns `0L` when `NumberFormatException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/teststats/ZtestPostAggregator.java:174— `zScoreTwoSamples` returns `0` when `IllegalArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
redundant comment web-console/src/dialogs/doctor-dialog/doctor-checks.tsx:111— "Check "file.encoding"" repeats the code it sits on: 3 of its 3 words (check, file, encoding) are already in `if (properties['file.encoding'] && properties['file.encoding'] !== 'UTF-8')`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment web-console/src/dialogs/doctor-dialog/doctor-checks.tsx:118— "Check "user.timezone"" repeats the code it sits on: 3 of its 3 words (check, user, timezone) are already in `if (properties['user.timezone'] && properties['user.timezone'] !== 'UTC')`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment web-console/src/druid-models/dart/dart-query-entry.ts:49— "Finished: descending finish time (startTime + durationMs)" repeats the code it sits on: 6 of its 7 words (finished, finish, time, start, duration, ms) are already in `const finishA = new Date(a.startTime).valueOf() + (a.durationMs ?? 0);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment web-console/src/druid-models/input-format/input-format-completions.ts:69— "Avro bytes decoder completions for avroBytesDecoder field" repeats the code it sits on: 4 of its 5 words (avro, bytes, decoder, completions) are already in `export const AVRO_BYTES_DECODER_COMPLETIONS: JsonCompletionRule[] = [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment web-console/src/druid-models/input-format/input-format-completions.ts:113— "Protobuf bytes decoder completions for protoBytesDecoder field" repeats the code it sits on: 5 of its 6 words (protobuf, bytes, decoder, completions, proto) are already in `export const PROTO_BYTES_DECODER_COMPLETIONS: JsonCompletionRule[] = [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment web-console/src/utils/base64-url.ts:20— "Encode to base64" repeats the code it sits on: 3 of its 3 words (encode, base, 64) are already in `return base64Encode(input)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×5
Diagnostic log message is built whether or not it is wanted server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:697— `debug` at line 697 is called with an argument built by `join(currentHydrants.entrySet().stream().map(entry -> StringUtils.format("…", entry.getKey(), entry.getValue())).coll...` (line 700), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:816— `debug` at line 816 is called with an argument built by `stream()` (line 818), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:217— `debug` at line 217 is called with an argument built by `String.join("…", before)` (line 217), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:375— `debug` at line 375 is called with an argument built by `String.join("…", ids)` (line 375), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceAutoScaler.java:430— `debug` at line 430 is called with an argument built by `String.join("…", instanceIds)` (line 430), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
X7 · Silent fallback defaults· Pending state with no failure state · ×5
Pending state with no failure state web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx:197— The view draws `<Loader/>` under `dartQueryEntriesState . isLoading ( )`, but `dartQueryEntriesState` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state web-console/src/views/explore-view/components/resource-pane/nested-column-dialog/nested-column-dialog.tsx:118— The view draws `<Loader/>` under `pathsState . isLoading ( )`, but `pathsState` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state web-console/src/dialogs/service-table-action-dialog/service-properties-table/service-properties-table.tsx:103— The view draws `<Loader/>` under `propertiesState . loading`, but `propertiesState` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state web-console/src/dialogs/datasource-table-action-dialog/datasource-columns-table/datasource-columns-table.tsx:90— The view draws `<Loader/>` under `columnsState . loading`, but `columnsState` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state web-console/src/components/supervisor-history-panel/supervisor-history-panel.tsx:61— The view draws `<Loader/>` under `historyState . loading`, but `historyState` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
README/code drift multi-stage-query/README.md:45— multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/input/ShuffleSpec.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/input/ShuffleSpec.java` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift multi-stage-query/README.md:97— multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/kernel/exec/ControllerImpl.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/kernel/exec/ControllerImpl.java` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift multi-stage-query/README.md:99— multi-stage-query/README.md links to `src/main/java/org/apache/druid/msq/kernel/exec/WorkerImpl.java`, but `multi-stage-query/src/main/java/org/apache/druid/msq/kernel/exec/WorkerImpl.java` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Silent fallback default in catch web-console/src/utils/ticks.ts:78— `timezoneAwareTicks` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch web-console/script/build-grammars.mjs:56— `modifiedTime` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 19 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (177 single-owned of 2870 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2870 of the 6354 production source files in this repository met that bar). They are anonymized user #10 (3 file(s)), anonymized user #11 (2 file(s)), anonymized user #12 (2 file(s)), anonymized user #13 (2 file(s)), anonymized user #14 (2 file(s)), anonymized user #15 (2 file(s)) (+13 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: server/src/main/java/org/apache/druid/server/http/LookupCoordinatorResource.java, server/src/main/java/org/apache/druid/query/lookup/LookupListeningResource.java, server/src/main/java/org/apache/druid/server/listener/resource/ListenerResource.java, processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java, processing/src/main/java/org/apache/druid/segment/StringDimensionHandler.java, sql/src/main/java/org/apache/druid/sql/avatica/DruidJdbcResultSet.java, extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchAggregatorFactory.java, multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryFrameProcessor.java (+21 more).
No ADRs found processing/pom.xml:512— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `processing/pom.xml` makes this repository a deployable product (line 512).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 8 of 80 project(s) overshoot their size bounds, lowering Project Cohesion to 8.0/10. The most over is `processing` (358886 LoC, 3056 module-visible types across 180 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 816 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authorization/db/cache/CoordinatorPollingBasicAuthorizerCacheManager.java, processing/src/main/java/org/apache/druid/guice/ExtensionsLoader.java, extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/CacheScheduler.java, indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTask.java, processing/src/main/java/org/apache/druid/segment/join/filter/JoinFilterCorrelations.java, extensions-core/s3-extensions/src/main/java/com/fasterxml/jackson/databind/PropertyNamingStrategies.java, server/src/main/java/org/apache/druid/server/coordinator/balancer/SegmentsCostCache.java, extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/updater/CoordinatorBasicAuthenticatorMetadataStorageUpdater.java (and 808 more) (842 orphaned of 3000 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 3000 of the 6354 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 56/57 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `extensions-core/parquet-extensions`.
P3 · Security & performance tooling· Dependabot does not watch pip · ×1
Dependabot does not watch pip REDACTED:2— `REDACTED` schedules updates, but no `package-ecosystem` entry covers `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
Changelog looks stale/thin — The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
R7 · Dead Code· Unused export 'DEFAULT_BROKER_DYNAMIC_CONFIG' · ×1
Unused export 'DEFAULT_BROKER_DYNAMIC_CONFIG' web-console/src/druid-models/broker-dynamic-config/broker-dynamic-config.mock.ts:21— Nothing ultimately consumes this binding: its only referrer is the re-export in web-console/src/druid-models/broker-dynamic-config/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web-console/src/druid-models/broker-dynamic-config/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'DEFAULT_COORDINATOR_DYNAMIC_CONFIG' · ×1
Unused export 'DEFAULT_COORDINATOR_DYNAMIC_CONFIG' web-console/src/druid-models/coordinator-dynamic-config/coordinator-dynamic-config.mock.ts:21— Nothing ultimately consumes this binding: its only referrer is the re-export in web-console/src/druid-models/mocks.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web-console/src/druid-models/mocks.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'summarizeExternalConfig' · ×1
Unused export 'summarizeExternalConfig' web-console/src/druid-models/external-config/external-config.ts:114— Nothing ultimately consumes this binding: its only referrer is the re-export in web-console/src/druid-models/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web-console/src/druid-models/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'InputSourceDesc' · ×1
Unused export 'InputSourceDesc' web-console/src/druid-models/input-source/input-source.tsx:83— Nothing ultimately consumes this binding: its only referrer is the re-export in web-console/src/druid-models/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web-console/src/druid-models/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'TaskStatusResponse' · ×1
Unused export 'TaskStatusResponse' web-console/src/druid-models/task/task.ts:33— Nothing ultimately consumes this binding: its only referrer is the re-export in web-console/src/druid-models/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web-console/src/druid-models/index.ts in the same commit, or the barrel will import a name that no longer exists.
R8 · Dependency Hygiene· Type-only dependency '@lezer/common' in production deps · ×1
Type-only dependency '@lezer/common' in production deps web-console/src/components/code-editor/completion-source.ts:28— Every import is type-only — move it to devDependencies.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 21/22 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Null assertions (`!`) override strict null checking — ~0.7 `!` null assertions per 1k TypeScript source lines — 52 assertion(s) across the 79306 source line(s) of the 405 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: web-console/src/views/explore-view/utils/table-query.ts (9), web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx (7), web-console/src/views/explore-view/modules/time-chart-module/continuous-chart-single-render.tsx (5). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Subsumed condition operand extensions-contrib/prometheus-emitter/src/main/java/org/apache/druid/emitter/prometheus/PrometheusEmitter.java:112— `address.startsWith("https")` can never decide this `||` — every value satisfying `address.startsWith("https")` also satisfies `address.startsWith("http")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Skipped (documented): testOverAssignForTimedOutSegments server/src/test/java/org/apache/druid/server/coordinator/rules/LoadRuleTest.java:187— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testGetQueryRunnerForSegments_whenSegmentIsClosedReportingMissingSegments server/src/test/java/org/apache/druid/server/coordination/ServerManagerTest.java:581— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): testChunkNotFinalized server/src/test/java/org/apache/druid/server/initialization/JettyTest.java:333— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testTimeouts server/src/test/java/org/apache/druid/server/initialization/JettyTest.java:231— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testWindowingErrorWithEngineFeatureOff sql/src/test/java/org/apache/druid/sql/calcite/CalciteCatalogIngestionDmlTest.java:1537— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): testReplaceIntoExtern sql/src/test/java/org/apache/druid/sql/calcite/CalciteExportTest.java:105— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testReplaceIntoExternParameterized sql/src/test/java/org/apache/druid/sql/calcite/CalciteExportTest.java:227— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testFilterAndGroupByLookupUsingJoinOperatorBackwards sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java:747— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): testInnerJoinOnMultiValueColumn sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java:2934— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testRemovableLeftJoin sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java:4727— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testGroupByAndOrderByAlias sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java:2347— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testProjectAfterSort3 sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java:13095— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): windowQueryTest sql/src/test/java/org/apache/druid/sql/calcite/CalciteWindowQueryTest.java:215— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): windowQueryTestsWithSubqueryBytes sql/src/test/java/org/apache/druid/sql/calcite/CalciteWindowQueryTest.java:239— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): ensureAllDeclared sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java:106— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): testPerf processing/src/test/java/org/apache/druid/timeline/IntervalTreeMapTest.java:256— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testBadLog processing/src/test/java/org/apache/druid/common/utils/LogTest.java:45— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testBloomFilterBigNoParam extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/sql/BloomDimFilterSqlTest.java:237— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testBloomFilterBigParameter extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/sql/BloomDimFilterSqlTest.java:265— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testFloatHiveCompat extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/BloomDimFilterTest.java:366— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testConcurrentUsage processing/src/test/java/org/apache/druid/query/groupby/having/DimFilterHavingSpecTest.java:83— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testGroupByWithEmptyStringProducingDimExtractionFn processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryRunnerTest.java:3849— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testLimitPerGrouping processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryRunnerTest.java:5241— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testInterleavedReserveAndRemove processing/src/test/java/org/apache/druid/query/groupby/GroupByResourcesReservationPoolTest.java:84— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
Skipped (documented): testMergeAggregatorsOneNullNotStrict processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryQueryToolChestTest.java:219— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
doc comments repeat the names web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:455— 0 of 19 documented parameters and 0 of 256 summaries in `web-console` only repeat the member or parameter name (e.g. "" for `spec`). 2 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
Off the main sequence: druid-aws-common — druid-aws-common: abstractness 0.00, instability 0.14, distance 0.86 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 5 file(s) — `extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/http/TableEditor.java`, `processing/src/main/java/org/apache/druid/query/context/docs/ParameterDocumentationGenerator.java`, `server/src/main/java/org/apache/druid/segment/loading/PartialSegmentBundleCacheEntry.java`, `server/src/main/java/org/apache/druid/segment/loading/PartialSegmentMetadataCacheEntry.java`, `sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemQueryContextParametersTable.java` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1d5b7-3af3-73bf-a215-7bf7f6ba23fc · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 92 · Warnings: 5474 · Recommendations: 3372 · Info: 145 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 13-11-2026 @ 16:21 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.