Public report of apache/carbondata, published 26 October 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 report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog 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, 26 October 2026, 08:23 UTC · Survey ID cd_35a0984e91d540829b672c4baeb9a69b

apache/carbondata

Measured 26 October 2026, 08:20 UTC, at code version b653d13

Regression: 1 dimension fell since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 53out of 100 At risk Up 1 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 large codebase: 242,203 lines of product code in 23 projects, tests not counted · Estimated rebuild effort: about 2.8 person-years · Weakest lens: Maturity, 48

Findings by how serious they are

69 critical 1653 serious 979 minor

14 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 08:20 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 Watchdog. It is open to any tool that implements it, and today Watchdog 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. Watchdog works 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 ▸

60of 60 dimensions measured by tools.
2683of 2701 findings point to an exact file and line, so you can open each one in the code. The other 18 concern the repository as a whole, such as missing documentation.
60dimensions across 6 lenses, read from 242,203 lines of product code in 23 projects.
Chapters

Executive summary

apache/carbondata is rated At risk because critical security findings are open. Its score is held back in part because we found no recorded design decisions and no architecture document or diagram. It scores 53 out of 100, which the At risk rating leaves unchanged.

Maturity, at 48, is the weakest lens and counts most in the score. The best first step is improving the documentation, worth about 6 points. Replacing the two exposed passwords or keys and switching the old ones off comes next, worth about 5 points. Raising Maturity to 70 would lift the score to about 57.

Thirty-one known security holes in the packages the code depends on can be used by attackers. Twenty-eight weaknesses in the code could be used by an attacker, and five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Updating the vulnerable packages, fixing the weaknesses the scanner points to and pinning each tool to an exact version would close these risks. The two passwords or keys in the code need replacing, with the old ones switched off. The pipeline step that runs a download without checking it needs each download checked against a known checksum first. The test that checks nothing needs to check the result it produces.

The product code is 242,203 lines, about €410,000 to rebuild. The check for the health of its packages couldn't finish, so that result is missing, not a clean pass.

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 for The 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.
Maturity 48 · counts for 46%Production Readiness 50 · counts for 25%Code Health 55 · counts for 14%Security and Compliance 57 · counts for 8%Architecture 95 · counts for 4%Performance 100 · counts for 2%

If Maturity rose from 48 to 70, the lowest score rated Strong, the score would rise from 53 to about 57.

Code composition: what the lines of code are
Product code 58%Tests 42%
New since the last survey: 4 findings

These 4 critical or serious findings weren't in the previous survey, on 12 October 2026.

  • Test Quality · No assertions (empty test): testPartitionOutput sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java
  • Secret Scanning · REDACTED
  • Explicit Debt · TodoComment repeated across 13 files integration/spark/src/test/scala/org/apache/spark/sql/carbondata/datasource/TestCreateTableUsingSparkCarbonFileFormat.scala
  • Supply-chain Provenance & Signing · REDACTED

Watchdog compares 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: 40 findings

These 40 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one.

  • Test Quality · No assertions: testRenameForceForException core/src/test/java/org/apache/carbondata/core/datastore/filesystem/ViewFsCarbonFileTest.java
  • Test Quality · No assertions: testBytePageDecode core/src/test/java/org/apache/carbondata/core/datastore/page/encoding/RLECodecTest.java
  • Test Quality · No assertions: testBytePageEncode core/src/test/java/org/apache/carbondata/core/datastore/page/encoding/RLECodecTest.java
  • Test Quality · No assertions: testSelectProperDeltaType core/src/test/java/org/apache/carbondata/core/datastore/page/encoding/TestEncodingFactory.java
  • Test Quality · No assertions: testSelectProperDeltaType2 core/src/test/java/org/apache/carbondata/core/datastore/page/encoding/TestEncodingFactory.java
  • Test Quality · No assertions: testaddBlockBasedOnMinMaxValue core/src/test/java/org/apache/carbondata/core/indexstore/blockletindex/TestBlockletIndex.java
  • Test Quality · No assertions: addIndexToCache core/src/test/java/org/apache/carbondata/core/indexstore/blockletindex/TestBlockletIndexFactory.java
  • Test Quality · No assertions: getValidDistributables core/src/test/java/org/apache/carbondata/core/indexstore/blockletindex/TestBlockletIndexFactory.java
  • Test Quality · No assertions: testBoundary core/src/test/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImplTest.java
  • Test Quality · No assertions: testPerformance core/src/test/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImplTest.java
  • Test Quality · No assertions: testRemoveInExpressionNodeWithDifferentColumn core/src/test/java/org/apache/carbondata/core/scan/filter/FilterUtilTest.java
  • Test Quality · No assertions: testRemoveInExpressionNodeWithPositionIdColumn core/src/test/java/org/apache/carbondata/core/scan/filter/FilterUtilTest.java
  • Test Quality · No assertions: IndexUsingBinarySearchLengthThree core/src/test/java/org/apache/carbondata/core/util/CarbonUtilTest.java
  • Test Quality · No assertions: IndexUsingBinarySearchLengthTwo core/src/test/java/org/apache/carbondata/core/util/CarbonUtilTest.java
  • Test Quality · No assertions: testPartitionOutput sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java
  • Test Quality · No assertions: testWriteJsonSchemaWithCustomDecimal sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java
  • Test Quality · No assertions: testWriteJsonSchemaWithCustomDecimalAndSpace sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java
  • Test Quality · No assertions: testWriteJsonSchemaWithDefaultDecimal sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java
  • Test Quality · No assertions: testWriteJsonSchemaWithImproperDecimal sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java
  • Test Quality · No assertions: testReadAfterClose sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CarbonReaderTest.java
  • Test Quality · No assertions: testReadFilesWithNullProjection sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CarbonReaderTest.java
  • Test Quality · No assertions: testBinaryWithComplexType sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ImageTest.java
  • Test Quality · No assertions: testHugeBinaryWithComplexType sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ImageTest.java
  • Test Quality · No assertions: testWriteBinaryWithInverted_index sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ImageTest.java
  • Test Quality · No assertions: testWriteBinaryWithLong_string_columns sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ImageTest.java
  • Test Quality · No assertions: testWriteBinaryWithSort sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ImageTest.java
  • Test Quality · No assertions: testWriteWithNull sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ImageTest.java
  • Test Quality · No assertions: testMinMax sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/MinMaxTest.java
  • Test Quality · No assertions: testMultipleORCFileLoad sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ORCCarbonWriterTest.java
  • Test Quality · No assertions: testORCFileLoadWithComplexSchema sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ORCCarbonWriterTest.java
  • Test Quality · No assertions: testOrcFileLoadAndCarbonRead sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ORCCarbonWriterTest.java
  • Test Quality · No assertions: testSDKPaginationFilter sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/PaginationCarbonReaderTest.java
  • Test Quality · No assertions: testSDKPaginationInsertData sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/PaginationCarbonReaderTest.java
  • Test Quality · No assertions: testParquetFileLoadWithMixSchema sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ParquetCarbonWriterTest.java
  • Test Quality · No assertions: testParquetFileLoadWithNestedMap sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ParquetCarbonWriterTest.java
  • Test Quality · No assertions: testParquetFileWithRepeatedSchema sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ParquetCarbonWriterTest.java
  • Test Quality · No assertions: testConfigurablePathForLock processing/src/test/java/org/apache/carbondata/lcm/locks/LocalFileLockTest.java
  • Test Quality · No assertions: testFileMergeSortComparator processing/src/test/java/org/apache/carbondata/processing/sort/sortdata/FileMergeSortComparatorTest.java
  • Explicit Debt · TodoComment repeated across 13 files core/src/main/java/org/apache/carbondata/core/scan/expression/logical/BinaryLogicalExpression.java
  • Supply-chain Provenance & Signing REDACTED
Rebuild cost: about €410,000 · Estimate
Cost to rebuild€140,000 to €680,000, for 2,250 to 7,138 hours of work, about 2.8 person-years for 1 to 6 engineers
Difficulty of the problemStandard, 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 53. 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.
SizeLarge: 242,203 lines of product code
What it is notNot 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: Watchdog prices 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 1 Documentation finding(s) in Documentation Quality — start with README.md.
Raises the score by about 6 points · Low effort · Documentation Quality
2
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).
Raises the score by about 5 points · Low effort · Secret Scanning
3
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.
Raises the score by about 4 points · Medium effort · Architecture documentation

Diagnosis: what the measurements show together

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 €410,000 to build again, about 2.8 person-years of work. Its weakest lens is Maturity, at 48 (Weak). Maturity is about how well the project explains and looks after itself, which decides whether a new developer, or a new supplier, can take over. Because the weakest lens counts most in the score, work on Maturity also moves the score most.
Based on: the rebuild estimate · the Maturity grade · how much each lens counts
What to do: Start with the Maturity actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Documentation finding(s) in Documentation Quality. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for low effort, because it clears the 1 Documentation 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
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 1,579 lines over the last 90 days, which is about 6,404 lines a year. At that pace, the extra work comes to an estimated 0.3 to 2.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

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.

arch CSDK CSDK apache-carbondata-agent apache-carbondata-agent carbondata-bloom carbondata-bloom carbondata-processing carbondata-processing carbondata-bloom->carbondata-processing carbondata-cli carbondata-cli carbondata-sdk carbondata-sdk carbondata-cli->carbondata-sdk carbondata-common carbondata-common carbondata-core carbondata-core carbondata-core->carbondata-common carbondata-format carbondata-format carbondata-core->carbondata-format carbondata-flink carbondata-flink carbondata-flink-proxy carbondata-flink-proxy carbondata-flink->carbondata-flink-proxy carbondata-flink->carbondata-format carbondata-hadoop carbondata-hadoop carbondata-flink->carbondata-hadoop carbondata-flink->carbondata-processing carbondata-flink->carbondata-sdk carbondata-flink-build carbondata-flink-build carbondata-flink-build->carbondata-flink carbondata-geo carbondata-geo carbondata-geo->carbondata-core carbondata-hadoop->carbondata-processing carbondata-hive carbondata-hive carbondata-hive->carbondata-hadoop carbondata-lucene carbondata-lucene carbondata-lucene->carbondata-core carbondata-mv-plan_${spark.binary.version} version} carbondata-presto carbondata-presto carbondata-presto->carbondata-bloom carbondata-presto->carbondata-hadoop carbondata-presto->carbondata-hive carbondata-processing->carbondata-core carbondata-sdk->carbondata-hadoop carbondata-spark_${spark.binary.version} version} carbondata-spark_${spark.binary.version}->carbondata-bloom carbondata-spark_${spark.binary.version}->carbondata-cli carbondata-spark_${spark.binary.version}->carbondata-geo carbondata-spark_${spark.binary.version}->carbondata-hive carbondata-spark_${spark.binary.version}->carbondata-lucene carbondata-spark_${spark.binary.version}->carbondata-mv-plan_${spark.binary.version} carbondata-streaming_${spark.binary.version} version} carbondata-spark_${spark.binary.version}->carbondata-streaming_${spark.binary.version} carbondata-streaming_${spark.binary.version}->carbondata-hadoop __more__ +3 more projects

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.

318 modules, with 1096 dependencies between them. 6 loops run through 83 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 278 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.
uses →1 carbondata.common2 carbondata.core.datastore.filesystem3 spark.sql.execution.command4 carbondata.core.metadata.blocklet5 carbondata.core.scan.filter.resolver6 carbondata.core.statusmanager7 carbondata.core.mutate8 carbondata.core.util9 carbondata.core.scan.model10 carbondata.core.scan.executor.infos11 carbondata.core.scan.scanner12 carbondata.core.scan.result13 carbondata.core.scan.processor14 carbondata.core.scan.filter15 carbondata.core.scan.filter.executer16 carbondata.core.scan.expression17 carbondata.core.metadata.schema.table18 carbondata.core.metadata.schema.table.column19 carbondata.core.metadata.datatype20 carbondata.hadoop21 carbondata.core.scan.result.vector22 carbondata.core.datastore.chunk.impl23 spark.sql24 carbondata.core.indexstore.blockletindex25 carbondata.core.indexstore26 carbondata.core.metadata27 carbondata.core.datastore.page.encoding28 carbondata.core.datastore.page29 carbondata.core.index.dev30 carbondata.core.index31 carbondata.core.datastore.block32 carbondata.processing.loading.model33 carbondata.core.datastore34 carbondata.index.bloom35 carbondata.core.scan.result.iterator36 carbondata.processing.loading37 carbondata.hadoop.api38 carbondata.processing.sort.sortdata39 carbondata.processing.store40 carbondata.processing.merger
1 carbondata.common
2 carbondata.core.datastore.filesystem
3 spark.sql.execution.command
4 carbondata.core.metadata.blocklet111
5 carbondata.core.scan.filter.resolver7122
6 carbondata.core.statusmanager424122
7 carbondata.core.mutate7311
8 carbondata.core.util3812116163324914271
9 carbondata.core.scan.model2229121
10 carbondata.core.scan.executor.infos1211212
11 carbondata.core.scan.scanner112122
12 carbondata.core.scan.result1111113211
13 carbondata.core.scan.processor21112124
14 carbondata.core.scan.filter312634112211
15 carbondata.core.scan.filter.executer117181675569
16 carbondata.core.scan.expression11341
17 carbondata.core.metadata.schema.table1172311
18 carbondata.core.metadata.schema.table.column331
19 carbondata.core.metadata.datatype16
20 carbondata.hadoop12211113
21 carbondata.core.scan.result.vector21139
22 carbondata.core.datastore.chunk.impl614
23 spark.sql322
24 carbondata.core.indexstore.blockletindex54211114421728692
25 carbondata.core.indexstore2432131181
26 carbondata.core.metadata9332111
27 carbondata.core.datastore.page.encoding141265
28 carbondata.core.datastore.page101153
29 carbondata.core.index.dev1113141192
30 carbondata.core.index553515115252
31 carbondata.core.datastore.block11261311
32 carbondata.processing.loading.model21211
33 carbondata.core.datastore1432211
34 carbondata.index.bloom211334111782
35 carbondata.core.scan.result.iterator5134511231
36 carbondata.processing.loading21141131
37 carbondata.hadoop.api32311161342642
38 carbondata.processing.sort.sortdata11247222
39 carbondata.processing.store11212231112
40 carbondata.processing.merger132421112462121194543
Uses a module listed above itPart of a loopThe module itself
1 carbondata.common2 carbondata.core.datastore.filesystem3 spark.sql.execution.command4 carbondata.core.metadata.blocklet5 carbondata.core.scan.filter.resolver6 carbondata.core.statusmanager7 carbondata.core.mutate8 carbondata.core.util9 carbondata.core.scan.model10 carbondata.core.scan.executor.infos11 carbondata.core.scan.scanner12 carbondata.core.scan.result13 carbondata.core.scan.processor14 carbondata.core.scan.filter15 carbondata.core.scan.filter.executer16 carbondata.core.scan.expression17 carbondata.core.metadata.schema.table18 carbondata.core.metadata.schema.table.column19 carbondata.core.metadata.datatype20 carbondata.hadoop21 carbondata.core.scan.result.vector22 carbondata.core.datastore.chunk.impl23 spark.sql24 carbondata.core.indexstore.blockletindex25 carbondata.core.indexstore26 carbondata.core.metadata27 carbondata.core.datastore.page.encoding28 carbondata.core.datastore.page29 carbondata.core.index.dev30 carbondata.core.index31 carbondata.core.datastore.block32 carbondata.processing.loading.model33 carbondata.core.datastore34 carbondata.index.bloom35 carbondata.core.scan.result.iterator36 carbondata.processing.loading37 carbondata.hadoop.api38 carbondata.processing.sort.sortdata39 carbondata.processing.store40 carbondata.processing.mergercarbondata.common1carbondata.core.datastore.filesystem2spark.sql.execution.command3carbondata.core.metadata.blocklet4carbondata.core.scan.filter.resolver5carbondata.core.statusmanager6carbondata.core.mutate7carbondata.core.util8carbondata.core.scan.model9carbondata.core.scan.executor.infos10carbondata.core.scan.scanner11carbondata.core.scan.result12carbondata.core.scan.processor13carbondata.core.scan.filter14carbondata.core.scan.filter.executer15carbondata.core.scan.expression16carbondata.core.metadata.schema.table17carbondata.core.metadata.schema.table.column18carbondata.core.metadata.datatype19carbondata.hadoop20carbondata.core.scan.result.vector21carbondata.core.datastore.chunk.impl22spark.sql23carbondata.core.indexstore.blockletindex24carbondata.core.indexstore25carbondata.core.metadata26carbondata.core.datastore.page.encoding27carbondata.core.datastore.page28carbondata.core.index.dev29carbondata.core.index30carbondata.core.datastore.block31carbondata.processing.loading.model32carbondata.core.datastore33carbondata.index.bloom34carbondata.core.scan.result.iterator35carbondata.processing.loading36carbondata.hadoop.api37carbondata.processing.sort.sortdata38carbondata.processing.store39carbondata.processing.merger40111712242412273113812116163324914271222912112112121121221111113211211121243126341122111171816755691134111723113311612211113211396143225421111442172869224321311819332111141265101153111314119255351511525211261311212111432211211334111782513451123121141131323111613426421124722211212231112132421112462121194543+278 more modules (most-connected shown)

At a glance — Code Health · 55% · Adequate · gated by D2, X5 ·

At a glance — Architecture · 95% · Exemplary ·

At a glance — Maturity · 48% · Weak · gated by D34, M2 ·

At a glance — Readiness · 50% · Adequate · gated by P3 ·

At a glance — Security · 57% · Adequate · gated by D29, D30, D36 ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures52High / Critical
A05:2025 — Injection45High / Critical
A07:2025 — Authentication Failures2High / Critical
A02:2025 — Security Misconfiguration2High / Critical

Roadmap

Begin by addressing the single documentation quality issue in README.md and resolving the two leaked secrets in REDACTED. Next, tackle the extensive knowledge freshness backlog by cleaning up orphaned files, prioritizing CarbonToSparkAdapter.scala, CarbonSessionStateBuilder.scala, and package.scala. Finally, establish a structured approach to architecture documentation by recording significant design decisions in a dedicated folder and enable nullable reference type checking across all projects to replace suppressions with proper handling.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md.+5.8 ptsLowDocumentation Quality
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).+4.6 ptsLowSecret Scanning
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.+4.4 ptsMediumArchitecture documentation
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with CSVCarbonWriterTest.java.+1.7 ptsLowTest Quality
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.+2.5 ptsMediumNullable reference types
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.+2.3 ptsMediumDocumentation (README)
Resolve the 921 Orphaned file finding(s) in Knowledge Freshness — start with CarbonToSparkAdapter.scala (3), CarbonSessionStateBuilder.scala (3), package.scala (3).+4.5 ptsHighKnowledge Freshness
Resolve the 1 Inverted test pyramid finding(s) in Test Distribution.+1.1 ptsLowTest Distribution

File quality

Per-file score 0–10 — a quality signature. Of 538 files carrying findings, judged against the Production bar: 2% slop · 59% mixed · 39% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.6SlopStatic Analysis (SAST): High: REDACTED
sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java1.7SlopTest Quality: No assertions (empty test): testPartitionOutput
REDACTED1.8SlopSecret Scanning: Leaked secret: REDACTED
REDACTED2.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.7SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED5.1MixedDependency Vulnerabilities: High CVE: REDACTED

How the grades work

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 — 69

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 — 1653

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 — 979

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 14

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

Watchdog 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. 60 of 60 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 60 dimensions across the health lenses
D1D2D3D4D5D6D9D10D13D15D16D17D19D26D27D28D29D30D31D34D35D36D43D44AX10AX3AX4AX6GD1M1M2M3P1P10P2P3P4P5P6PF3X12X13X14X15X16X17X18X19X20X21X22X23X24X25X26X28X29X30X32X5

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
  1. 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, 2683 of 2701 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a1774c-6a00-70f1-97db-e6becbf8a16a.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

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 — Watchdog 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: test source is present (.java, .py, .scala) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report`, or `coverage run -m pytest` then `coverage xml`, or `addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report`, or `coverage run -m pytest` then `coverage xml`, or `addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 950 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 453 test source file(s) (.py, .scala) 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 — Watchdog 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 source is present (.java, .py, .scala) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — Watchdog 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 repository's dependency manifests WERE read and their pinning discipline assessed; what went unanswered is the currency half, because packages.confluent.io — the registry that answers it — was asked and did not reply (the build stopped because packages.confluent.io, a repository this project declares, refused it with HTTP 403 — what this scan's egress allowlist returns for a host that is not on it; 63 dependencies were resolved and graded first, but the graph is partial so the result is reported and not scored). This is OUR side and it is an ENVIRONMENT fault, not a missing collector: the collector exists and ran. An HTTP 403 here is what this scan's egress allowlist returns for a host that is not on it, so the remedy is to add packages.confluent.io to the allowlist and re-run — not to build anything.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 — Watchdog measured this, but not all of it. What it 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 — Watchdog 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.
  • D22 Internal API Consistency — not measured this run — Watchdog 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's deterministic call-shape 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. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog 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 the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. Tracing effort is measured over resolved call sites, and all 1338 sampled here came from .java files. This repository's .scala source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
  • AXR1 Runtime accessibility — not measured this run — Watchdog 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 (REDACTED). docker build failed (exit 1) — 1 | >>> FROM jupyter/all-spark-notebook:spark-3.1.1 2 | USER root 3 | WORKDIR . -------------------- ERROR: failed to solve: jupyter/all-spark-notebook:spark-3.1.1: failed to resolve source metadata for docker.io/jupyter/all-spark-notebook:spark-3.1.1: failed to do request: Head "https://registry-1.docker.io/v2/jupyter/all-spark-notebook/manifests/spark-3.1.1": Forbidden; runtime evidence skipped.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X1 Async correctness — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X2 Cancellation propagation — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog 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 repository's C# was parsed (it ships no .sln or .csproj, so it was read as syntax-only projects), but this check proves its findings from resolved symbols and a reference-free parse resolves none. It abstained rather than report a clean bill it could not earn. That is a gap in this analyzer's reach into build-less repositories — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X4 Structured logging — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does 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.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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 Secret Scanning: Secret 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").
  • 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.
  • 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.
  • 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.
  • 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.

Dimensions

D1 · Cyclomatic Complexity6.4 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 6.4 / 10 · rule-coverage 100% · ceiling Prevented

182 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was 1.fillPrimitiveType at 71. A further 14 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 CarbonFilters.translateExpression at 42 — they are counted neither in the figure above nor in this dimension's score. 3 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: core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java (CarbonProperties.validateAndLoadDefaultProperties at 28), sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java (ORCCarbonWriter.orcToCarbonSchemaConverter at 21), integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala (CommonUtil.validateTypeConvertForSpark2 at 17). 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.

SparkVersionAdapter.createCarbonTable (cyclomatic 27) · ×2integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:230
1.decodeAndFillVector (cyclomatic 26) · ×2core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:253
1.fillPrimitiveType (cyclomatic 71)core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:328
MVMatchPattern.doMatch (cyclomatic 69)integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:305
1.fillVector (cyclomatic 68)core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:327

+ 175 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with 1.fillPrimitiveType (cyclomatic 71), MVMatchPattern.doMatch (cyclomatic 69), 1.fillVector (cyclomatic 68). — 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 3 together lifts Cyclomatic Complexity from 6.4 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity3.8 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 3.8 / 10 · rule-coverage 100% · ceiling Prevented

462 method(s) exceeded the cognitive complexity threshold of 15; the worst was StreamRecordReader.readRowFromStream at 180.

SparkVersionAdapter.createCarbonTable (cognitive 49) · ×2integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:230
1.decodeAndFillVector (cognitive 42) · ×2core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:253
CarbonIndexFileMergeWriter.mergeCarbonIndexFilesOfSegment (cognitive 18) · ×2core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileMergeWriter.java:129
StreamRecordReader.readRowFromStream (cognitive 180)hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:355
1.fillVector (cognitive 150)core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:327

+ 454 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 5 bodies over 120 down to 120 or less in Cognitive Complexity — start with StreamRecordReader.readRowFromStream (cognitive 180), 1.fillVector (cognitive 150), 1.fillPrimitiveType (cognitive 150). — 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 5 together lifts Cognitive Complexity from 3.8 to about 4.5/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.2 / 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.

Maturity: Documented → Verified → Prevented · effective 8.2 / 10 · rule-coverage 100% · ceiling Prevented

135 god class(es) detected.

TooManyMethods: CarbonUtil · ×51core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:138
FileTooLong: util/CarbonUtil.java · ×40core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
ClassTooLong: CarbonUtil · ×31core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:138
MethodTooLong: 1.fillPrimitiveType · ×13core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:328

What to do

  1. Resolve the 51 TooManyMethods finding(s) in God Classes — start with ColumnarVectorWrapperDirect.java (2), SparkVersionAdapter.scala (2), CarbonUtil.java. — One of this dimension's main actionable groups (51 warning-level).
  2. Resolve the 40 FileTooLong finding(s) in God Classes — start with CarbonUtil.java, CarbonProperties.java, MVMatcher.scala. — One of this dimension's main actionable groups (40 warning-level).
  3. Resolve the 31 ClassTooLong finding(s) in God Classes — start with CarbonUtil.java, CarbonProperties.java, SegmentFileStore.java. — One of this dimension's main actionable groups (31 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.0 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Verified

503 duplicated block group(s) detected. A further 28 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 27 of the 531 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (7 lines × 2) · ×33core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:87
Duplicated block (10 lines × 2) · ×32core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java:235
Duplicated block (6 lines × 2) · ×32core/src/main/java/org/apache/carbondata/core/datastore/chunk/impl/VariableLengthDimensionColumnPage.java:116
Duplicated block (5 lines × 2) · ×32core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentProperties.java:373
Duplicated block (8 lines × 2) · ×31core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/AbstractDimensionChunkReader.java:120

+ 138 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 33 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with CarbonDataProcessorUtil.java (2), ORCCarbonWriter.java (2), SQLBuildDSL.scala (2). — One of this dimension's main actionable groups (33 warning-level).
  2. Resolve the 32 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with ExcludeFilterExecutorImpl.java (4), CarbonUtil.java (2), CarbonLocalWriter.java (2). — One of this dimension's main actionable groups (32 warning-level).
  3. Resolve the 32 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with ExcludeFilterExecutorImpl.java (3), AvroCarbonWriter.java (2), VariableLengthDimensionColumnPage.java. — One of this dimension's main actionable groups (32 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling8.9 / 10Strong✓ 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.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Prevented

23 production modules (Maven+Python+CMake), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 3 module(s) off the main sequence, with abstractness counted on 18 of the 23 (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: carbondata-flink-proxy · ×2
Unstable project carbondata-flink
Off the main sequence: carbondata-common

What to do

  1. Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 Unstable project carbondata-flink finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 3 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

3 of 355 classes have LCOM4 above 3.

Low cohesion: CarbonTableConfig (LCOM4 13) · ×3integration/presto/src/main/java/org/apache/carbondata/presto/impl/CarbonTableConfig.java:25

What to do

  1. Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with CarbonTableConfig.java, CarbonAntlrSqlVisitor.java, AvroCarbonWriter.java. — One of this dimension's main actionable groups (3 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution9.2 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.2 / 10 · rule-coverage 100% · ceiling Documented

9979 test methods: 1332 unit, 8647 integration, 0 BDD, 0 e2e. The Python suite contributes 95 test function(s) across 14 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Scala suite contributes 8934 test case(s) across 371 file(s) in a test source set declaring at least one — every `test("…")`, `it("…")`, `property("…")` and `"…" in {…}` registration and every JUnit `@Test`, which is how munit, ScalaTest, utest, ZIO Test and specs2 declare a case; a case registered under a computed name is not counted, so this is a floor. Its tier split is INFERRED from paths and file names, except sbt's src/it source set, which the build declares.

Inverted test pyramid

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md · top locations in Appendix A, every location in findings.md.

D10 · Test Quality8.7 / 10Adequategated by 1 critical finding✓ 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.

Maturity: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Prevented

6 skipped (6 with a documented reason), 82 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 950 tests. Measured on the .java suite only — at least 453 test source file(s) (.py, .scala) went unread, so its test quality is unmeasured and is not in these counts.

No assertions (empty test): testPartitionOutputsdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java:335
No assertions: testCleanLogs · ×81common/src/test/java/org/apache/carbondata/common/logging/impl/ExtendedRollingFileAppenderTest_UT.java:47
Skipped (documented): testCreateHashID · ×6geo/src/test/java/org/apache/carbondata/geo/QuadTreeClsTest.java:119

What to do

  1. Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with CSVCarbonWriterTest.java. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 81 No assertions finding(s) in Test Quality — start with ExpressionResultTest.java (19), CarbonUtilTest.java (8), DFSFileReaderImplUnitTest.java (5). — One of this dimension's main actionable groups (81 warning-level).
  3. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · Secret Scanning5.0 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D16 · Bus Factor9.9 / 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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

2 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is core/src/main/java/org/apache/carbondata/core/index/IndexInputFormat.java. Counted over 399 of the 1405 production source files in this repository: 469 are under the ~2,400-byte size floor this dimension measures over, and the remaining 537 have no attributable history left to measure.

Off-boarding risk: anonymized user #1

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.8 / 10Stronggated by 228 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Prevented

246 deducted task-comment markers across 242203 LoC (0.1/KLoC) → score 9.8. 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.

TodoComment · ×227streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:247
TodoComment repeated across 13 filesintegration/spark/src/test/scala/org/apache/spark/sql/carbondata/datasource/TestCreateTableUsingSparkCarbonFileFormat.scala:129

What to do

  1. Resolve the 227 TodoComment finding(s) in Explicit Debt — start with test_carbon_end_to_end.py (6), TestNonTransactionalCarbonTable.scala (6), MVMatcher.scala (6). — One of this dimension's main actionable groups (227 warning-level).
  2. Resolve the 1 TodoComment repeated across 13 files finding(s) in Explicit Debt — start with TestCreateTableUsingSparkCarbonFileFormat.scala. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

0 of 1 documentation facets pass in full; short on: F2 example. 48 document(s) read across 1 unit(s).

Documentation: no build, run or usage exampleREADME.md:1

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion6.8 / 10Adequate✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 6.8 / 10 · rule-coverage 100% · ceiling Documented

3 of 19 build units (Maven, Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. 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.

D27 · Navigability9.6 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

62 % of calls cross a namespace and 8 % 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. Measured over the .java source only — this repository's .scala was not sampled for call sites, so this score covers part of the tree, not all of it.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret 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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

45 finding(s): 0 critical, 34 high, 11 medium, 0 low. 5 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. Separately, one or more rules could not re-parse an embedded snippet in 1 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

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 28 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (28 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 5 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 (5 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

45 finding(s): 12 critical, 19 high, 13 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 19 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (19). — One of this dimension's main actionable groups (19 issue-level).
  2. Resolve the 13 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (13). — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 12 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (12). — One of this dimension's main actionable groups (12 issue-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security9.6 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 1 high, 1 medium, 0 low.

REDACTED
REDACTED

What to do

  1. 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).
  2. Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness0.1 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.1 / 10 · rule-coverage 100% · ceiling Documented

924 of 936 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java. Counted over 936 of the 1405 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×921integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:1
Most significant orphaned file · ×3core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1
Concentrated knowledge decay

What to do

  1. Resolve the 921 Orphaned file finding(s) in Knowledge Freshness — start with CarbonToSparkAdapter.scala (3), CarbonSessionStateBuilder.scala (3), package.scala (3). — One of this dimension's main actionable groups (921 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with CarbonUtil.java, REDACTED, CarbonProperties.java. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Concentrated knowledge decay 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.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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. Scored 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. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 129 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.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition9.9 / 10Exemplary✓ Tool-verified

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.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation9.8 / 10Exemplary✓ Tool-verified

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.

  • `GenericDataType<T>` declares 17 abstract methods: `addChildren`, `deepCopy`, `getAllPrimitiveChildren`, `getColsCount`, `getColumnNames`, `getColumnarDataForComplexType`, `getComplexColumnInfo`, `getDataCounter`, `getDepth`, `getIsColumnDictionary`, `getMaxOutputArrayIndex`, `getName`, `getParentName`, `parseComplexValue`, `setOutputArrayIndex`, `setSurrogateIndex`, `writeByteArray`. 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/carbondata/processing/datatypes/GenericDataType.java:35
  • `Compressor` declares 23 abstract methods: `compressByte`, `compressByte`, `compressByte`, `compressDouble`, `compressFloat`, `compressInt`, `compressLong`, `compressShort`, `getName`, `maxCompressedLength`, `rawCompress`, `rawUncompress`, `rawUncompress`, `supportReusableBuffer`, `supportUnsafe`, `unCompressByte`, `unCompressByte`, `unCompressDouble`, `unCompressFloat`, `unCompressInt`, `unCompressLong`, `unCompressShort`, `unCompressedLength`. 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 23 declarations carry 19 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 19 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. — core/src/main/java/org/apache/carbondata/core/datastore/compression/Compressor.java:23
  • `CarbonFile` declares 42 abstract methods: `createNewFile`, `createNewFile`, `createNewLockFile`, `delete`, `deleteFile`, `exists`, `getAbsolutePath`, `getCanonicalPath`, `getDataInputStream`, `getDataInputStream`, `getDataInputStream`, `getDataOutputStream`, `getDataOutputStream`, `getDataOutputStream`, `getDataOutputStream`, `getDataOutputStream`, `getDataOutputStreamUsingAppend`, `getDefaultReplication`, `getLastModifiedTime`, `getLength`, `getLocations`, `getName`, `getParentFile`, `getPath`, `getSize`, `isDirectory`, `isFileExist`, `isFileExist`, `isFileModified`, `listDirs`, `listFiles`, `listFiles`, `listFiles`, `listFiles`, `listFiles`, `locationAwareListFiles`, `mkdirs`, `renameForce`, `renameTo`, `setLastModifiedTime`, and 2 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 42 declarations carry 30 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 30 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. — core/src/main/java/org/apache/carbondata/core/datastore/filesystem/CarbonFile.java:28
  • `ColumnPageValueConverter` declares 16 abstract methods under just 4 distinct name(s): `decodeAndFillVector`, `decodeDouble`, `decodeDouble`, `decodeDouble`, `decodeDouble`, `decodeDouble`, `decodeDouble`, `decodeLong`, `decodeLong`, `decodeLong`, `encode`, `encode`, `encode`, `encode`, `encode`, `encode`. 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. That is an OVERLOAD SET, not 16 separate responsibilities: a caller binds to 4 operation(s) and uses the overload it selected, so the Interface-Segregation harm does NOT apply on the caller's side and splitting this into role-interfaces would scatter one operation without relieving anything. The burden that does remain is the IMPLEMENTER's — all 16 signatures must be written and kept in step. Reduce it by collapsing overloads (optional or default parameters, or an options object) rather than by segregating the interface. — core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPageValueConverter.java:26
  • `CarbonColumnVector` declares 41 abstract methods: `getBlockDataType`, `getData`, `getDictionaryVector`, `getType`, `hasDictionary`, `isNull`, `putAllByteArray`, `putArray`, `putBoolean`, `putByte`, `putByteArray`, `putByteArray`, `putByteArray`, `putBytes`, `putDecimal`, `putDecimals`, `putDouble`, `putDoubles`, `putDoubles`, `putFloat`, `putFloats`, `putInt`, `putInts`, `putInts`, `putLong`, `putLongs`, `putLongs`, `putNotNull`, `putNotNull`, `putNull`, `putNulls`, `putObject`, `putShort`, `putShorts`, `putShorts`, `reset`, `setBlockDataType`, `setCarbonDataFileWrittenVersion`, `setDictionary`, `setFilteredRowsExist`, and 1 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 41 declarations carry 34 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 34 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. — core/src/main/java/org/apache/carbondata/core/scan/result/vector/CarbonColumnVector.java:27
  • `CarbonMetaStore` declares 20 abstract members: `lookupRelation`, `lookupRelation`, `lookupAnyRelation`, `createCarbonRelation`, `tableExists`, `tableExists`, `updateTableSchemaForAlter`, `updateTableSchema`, `revertTableSchemaInAlterFailure`, `saveToDisk`, `generateTableSchemaString`, `removeTableFromMetadata`, `updateMetadataByThriftTable`, `isTablePathExists`, `dropTable`, `isSchemaRefreshed`, `isReadFromHiveMetaStore`, `listAllTables`, `getThriftTableInfo`, `createCarbonDataSourceHadoopRelation`. Counted over its ABSTRACT members — a `def` with no body or a `val`/`var` with no initializer, once per signature; concrete members, private and protected members, and members of a companion `object` are not counted, because no implementer is forced to write them. Those 20 declarations carry 18 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 18 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. — integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonMetaStore.scala:35

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
  • Where the width is an overload set rather than separate responsibilities, collapse the overloads instead — segregating those relieves no caller.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 24 of 25 project(s) that lack one — worth up to 1.9 pts.
M2 · Architecture documentation0.0 / 10Critical✓ Tool-verified

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.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

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.
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability6.6 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 13/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `Agent_module`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling3.0 / 10Weak✓ Tool-verified

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.

What to do

  • Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

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.

P5 · DR & Backup4.0 / 10Weak✓ 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.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
  • Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
P6 · Release Hygiene5.0 / 10Adequate✓ 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.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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 the language 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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. 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 `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

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.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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.

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

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 `ArgumentNullException` 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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

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.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

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.

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.

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.

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.

X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.

Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.

X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 0/1 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.

What to do

  • Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.

Reference — by lens

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.

LensScoreRatingImpact
Code Health55%Adequate — gated by D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture95%ExemplarySolid.
Maturity48%Weak — gated by D34, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness50%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security57%Adequate — gated by D29, D30, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100%ExemplaryStrongest area.
Unscored — 2 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.

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 57 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.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) 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
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • 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) — 1 | >>> FROM jupyter/all-spark-notebook:spark-3.1.1 2 | USER root 3 | WORKDIR . -------------------- ERROR: failed to solve: jupyter/all-spark-notebook:spark-3.1.1: failed to resolve source metadata for docker.io/jupyter/all-spark-notebook:spark-3.1.1: failed to do request: Head "https://registry-1.docker.io/v2/jupyter/all-spark-notebook/manifests/spark-3.1.1": Forbidden; 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 — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • D11 Test Reliability — Test reliability not included — no .scala test runner
  • D12 Dependency Hygiene — Dependency currency not established — packages.confluent.io did not answer
  • D14 License Compliance — Not scored — this repository's 87 declared JVM dependency coordinate(s) were read from its 25 Maven/Gradle manifest(s), but Maven Central could not be asked for the licence of 3 of them (HTTP 403 Forbidden from https://repo1.maven.org/maven2/org/apache/flink/flink-clients_${scala.binary.version}/1.12.2/flink-clients_${scala.binary.version}-1.12.2.pom), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
  • 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.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Java, Python, Scala not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Python surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .java, .py, .scala, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — 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.
  • 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.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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 included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (1 of 2 signals for this style — below the bar we score at): 203 value object(s)
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • IC1 Incompleteness & stubs — 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
  • M4 Documentation accuracy — Not applicable: the 49 current-state document(s) make no claim of a kind M4 checks. 30 claim(s) of kinds M4 does not check were not checked (path 2, command argument 1, environment variable 27); M4 checks only links and versions.
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM, Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • PF2 Allocation hygiene — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • X1 Async correctness — 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
  • X2 Cancellation propagation — 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
  • X27 Collection changed while being enumerated — This check needs a compiled C# program and this repository commits no project file to compile, so only its syntax could be read. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — 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
  • X4 Structured logging — 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
  • X9 Subsumed condition operand — 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.

Critical — 69 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 3 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×19
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · Secret Scanning · Leaked secret · ×2
  • REDACTED
  • REDACTED
D10 · Test Quality · No assertions (empty test) · ×1
  • No assertions (empty test): testPartitionOutput sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java:335 — Test method has an empty body — it asserts nothing and exercises no code.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · High IaC · ×1
  • REDACTED
Serious — 1653 finding(s)
D17 · Explicit Debt · TodoComment · ×227
  • TodoComment streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:247 — // TODO: handle the min max writing for string type based on character limit for streaming — 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 streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:311 — // TODO better to check backup index at first — 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 sdk/sdk/src/test/java/org/apache/carbondata/store/LocalCarbonStoreTest.java:36 — // TODO: complete this testcase — 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 sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java:291 — // TODO: implement reader to verify the number of blocklet in the file — 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 sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java:329 — // TODO: implement reader and verify the data is sorted — 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 sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java:336 — // TODO: test write data with partition — 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 sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java:382 — // TODO: write all data type and read by CarbonRecordReader to verify the content — 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 sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java:590 — //TODO: CarbonReader has a bug which does not allow reading complex. Once it is fixed below validation can be enabled — 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 sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CarbonReaderTest.java:1481 — // TODO: support get schema of complex data type — 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 sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/ImageTest.java:252 — // TODO: should throw exception — 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 sdk/sdk/src/main/java/org/apache/carbondata/store/LocalCarbonStore.java:75 — // TODO: use InputFormat to prune data and read data — 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 sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonSchemaReader.java:291 — //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 sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonSchemaReader.java:351 — //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 sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/PaginationCarbonReader.java:174 — // TODO: read blocklets in multi-thread if there is a performance requirement. — 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 sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/cache/BlockletRows.java:54 — // TODO: not applicable ? — 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 python/pycarbon/tests/sdk/test_read_write_carbon.py:159 — # TODO: to be supported — 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 python/pycarbon/tests/core/test_carbon_end_to_end.py:169 — # TODO: fix make_batch_carbon_reader error — 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 python/pycarbon/tests/core/test_carbon_end_to_end.py:194 — # TODO: fix make_batch_carbon_reader error — 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 python/pycarbon/tests/core/test_carbon_end_to_end.py:217 — # TODO: fix test_partition_multi_node — 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 python/pycarbon/tests/core/test_carbon_end_to_end.py:241 — # TODO: fix test_partition_value_error — 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 python/pycarbon/tests/core/test_carbon_end_to_end.py:275 — # TODO(yevgeni): factor out. Reading all ids appears multiple times in 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 python/pycarbon/tests/core/test_carbon_end_to_end.py:350 — # TODO: fix test_make_carbon_reader_fails_loading_non_unischema_dataset — 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 python/pycarbon/tests/core/test_carbon_tf_dataset.py:85 — # TODO(yevgeni): check that the shapes are actually correct, not just not None — 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 python/pycarbon/tests/core/test_carbon_tf_dataset.py:178 — # TODO(yevgeni): check that the shapes are actually correct, not just not None — 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 python/pycarbon/integration/tensorflow.py:222 — # TODO: implement a mechanism for signaling that we have no more data — 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.
  • + 202 more in this group — see findings.md.
D10 · Test Quality · No assertions · ×81
  • No assertions: testCleanLogs common/src/test/java/org/apache/carbondata/common/logging/impl/ExtendedRollingFileAppenderTest_UT.java:47 — 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: testMkStringNullDelimiter common/src/test/java/org/apache/carbondata/common/StringsSuite.java:31 — 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: testMkStringNullString common/src/test/java/org/apache/carbondata/common/StringsSuite.java:26 — 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: testDoubleForIoException core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/DFSFileReaderImplUnitTest.java:134 — 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: testDoubleForIoExceptionwithUpdateCache core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/DFSFileReaderImplUnitTest.java:139 — 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: testReadIntForIoException core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/DFSFileReaderImplUnitTest.java:106 — 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: testReadIntWithFileNameForIOException core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/DFSFileReaderImplUnitTest.java:123 — 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: testReadLongForIoException core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/DFSFileReaderImplUnitTest.java:101 — 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: testFileExistsForDefaultType core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/FileFactoryImplUnitTest.java:76 — 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: testFileExistsForVIEWFSType core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/FileFactoryImplUnitTest.java:72 — 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: testDoubleForIoException core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/FileReaderImplUnitTest.java:134 — 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: testReadIntForIoException core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/FileReaderImplUnitTest.java:107 — 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: testReadIntWithFileNameForIOException core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/FileReaderImplUnitTest.java:123 — 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: testReadLongForIoException core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/FileReaderImplUnitTest.java:103 — 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: testListFilesForException core/src/test/java/org/apache/carbondata/core/datastore/filesystem/AlluxioCarbonFileTest.java:176 — 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: testRenameForceForException core/src/test/java/org/apache/carbondata/core/datastore/filesystem/AlluxioCarbonFileTest.java:86 — 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: testListFilesForException core/src/test/java/org/apache/carbondata/core/datastore/filesystem/HDFSCarbonFileTest.java:205 — 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: testFilesForConnicalPathException core/src/test/java/org/apache/carbondata/core/datastore/filesystem/LocalCarbonFileTest.java:354 — 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: testtruncateForException core/src/test/java/org/apache/carbondata/core/datastore/filesystem/LocalCarbonFileTest.java:222 — 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: testListFilesForException core/src/test/java/org/apache/carbondata/core/datastore/filesystem/ViewFsCarbonFileTest.java:184 — 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: testGetDirectDictionaryGenerator core/src/test/java/org/apache/carbondata/core/keygenerator/directdictionary/DirectDictionaryKeyGeneratorFactoryUnitTest.java:29 — 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: equalsTestWithDifferentLength core/src/test/java/org/apache/carbondata/core/localdictionary/DictionaryByteArrayWrapperTest.java:62 — 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: testNullDbName core/src/test/java/org/apache/carbondata/core/metadata/schema/table/CarbonTableBuilderSuite.java:39 — 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: testNullSchema core/src/test/java/org/apache/carbondata/core/metadata/schema/table/CarbonTableBuilderSuite.java:49 — 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: testNullTableName core/src/test/java/org/apache/carbondata/core/metadata/schema/table/CarbonTableBuilderSuite.java:28 — 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.
  • + 56 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×51
  • TooManyMethods: CarbonUtil core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:138 — TooManyMethods — 137 methods. The bar is 30 methods; this is 107 over it, 4.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: CarbonProperties core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java:79 — TooManyMethods — 119 methods. The bar is 30 methods; this is 89 over it, 3.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: CarbonLoadModel processing/src/main/java/org/apache/carbondata/processing/loading/model/CarbonLoadModel.java:35 — TooManyMethods — 110 methods. The bar is 30 methods; this is 80 over it, 3.67× 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: CarbonTable core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:79 — TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.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: SortParameters processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:40 — TooManyMethods — 88 methods. The bar is 30 methods; this is 58 over it, 2.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: ColumnPage core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:48 — TooManyMethods — 87 methods. The bar is 30 methods; this is 57 over it, 2.90× 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: BlockExecutionInfo core/src/main/java/org/apache/carbondata/core/scan/executor/infos/BlockExecutionInfo.java:36 — TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.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.
  • TooManyMethods: CarbonInputSplit core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:61 — 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: CarbonColumnVectorImpl core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java:34 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. Most of these members implement vector.CarbonColumnVector (35 of 51 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: CarbonDataLoadConfiguration processing/src/main/java/org/apache/carbondata/processing/loading/CarbonDataLoadConfiguration.java:36 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× 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: CarbonFactDataHandlerModel processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerModel.java:57 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× 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: BlockIndex core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java:80 — 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: CarbonInputFormat hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java:99 — 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: SegmentFileStore core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:83 — 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.
  • TooManyMethods: BlockletScannedResult core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:55 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: ColumnVectorProxy integration/spark/src/main/java/org/apache/spark/sql/CarbonVectorProxy.java:142 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: CarbonWriterBuilder sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:70 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: AbstractDFSCarbonFile core/src/main/java/org/apache/carbondata/core/datastore/filesystem/AbstractDFSCarbonFile.java:59 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.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.
  • TooManyMethods: FileFactory core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java:55 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.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.
  • TooManyMethods: CarbonTablePath core/src/main/java/org/apache/carbondata/core/util/path/CarbonTablePath.java:38 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.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.
  • TooManyMethods: UnsafeFixLengthColumnPage core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeFixLengthColumnPage.java:36 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: LocalDictColumnPage core/src/main/java/org/apache/carbondata/core/datastore/page/LocalDictColumnPage.java:42 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: ByteUtil core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:30 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× 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: LVByteBufferColumnPage core/src/main/java/org/apache/carbondata/core/datastore/page/LVByteBufferColumnPage.java:41 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.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: FilterUtil core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:97 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.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.
  • + 26 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×40
  • FileTooLong: util/CarbonUtil.java core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java — FileTooLong — 2091 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: CarbonUtil (138-3579). The bar is 500 significant lines; this is 1591 over it, 4.18× 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: util/CarbonProperties.java core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java — FileTooLong — 1451 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: CarbonProperties (79-2235). The bar is 500 significant lines; this is 951 over it, 2.90× 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: optimizer/MVMatcher.scala integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala — FileTooLong — 1150 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 650 over it, 2.30× 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: management/CommonLoadUtils.scala integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala — FileTooLong — 970 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 470 over it, 1.94× 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/SegmentFileStore.java core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java — FileTooLong — 947 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: SegmentFileStore (83-1645). The bar is 500 significant lines; this is 447 over it, 1.89× 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: statusmanager/SegmentStatusManager.java core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java — FileTooLong — 875 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: SegmentStatusManager (70-1400). The bar is 500 significant lines; this is 375 over it, 1.75× 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: REDACTED REDACTED — FileTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: CarbonCommonConstants (25-2900). The bar is 500 significant lines; this is 337 over it, 1.67× 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: filter/FilterUtil.java core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java — FileTooLong — 826 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: FilterUtil (97-1390). The bar is 500 significant lines; this is 326 over it, 1.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: catalyst/CarbonParserUtil.scala integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala — FileTooLong — 812 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 312 over it, 1.62× 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: optimizer/MVRewrite.scala integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala — FileTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: MVRewrite (54-1143). The bar is 500 significant lines; this is 311 over it, 1.62× 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: util/DataTypeUtil.java core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java — FileTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: DataTypeUtil (55-1205). The bar is 500 significant lines; this is 282 over it, 1.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: util/AlterTableUtil.scala integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala — FileTooLong — 753 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 253 over it, 1.51× 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: util/CarbonLoaderUtil.java processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java — FileTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: CarbonLoaderUtil (65-1259). The bar is 500 significant lines; this is 235 over it, 1.47× 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: util/CommonUtil.scala integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala — FileTooLong — 728 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 228 over it, 1.46× 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: rdd/CarbonDataRDDFactory.scala integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala — FileTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 227 over it, 1.45× 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: table/CarbonTable.java core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java — FileTooLong — 701 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: CarbonTable (79-1295). The bar is 500 significant lines; this is 201 over it, 1.40× 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: command/carbonTableSchemaCommon.scala integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala — FileTooLong — 673 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 173 over it, 1.35× 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: file/AvroCarbonWriter.java sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java — FileTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 168 over it, 1.34× 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: blockletindex/BlockIndex.java core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java — FileTooLong — 654 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: BlockIndex (80-1046). The bar is 500 significant lines; this is 154 over it, 1.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: file/CarbonWriterBuilder.java sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java — FileTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: CarbonWriterBuilder (70-1209). The bar is 500 significant lines; this is 133 over it, 1.27× 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: merger/CarbonDataMergerUtil.java processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java — FileTooLong — 624 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: CarbonDataMergerUtil (71-1138). The bar is 500 significant lines; this is 124 over it, 1.25× 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: parser/CarbonSpark2SqlParser.scala integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala — FileTooLong — 621 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: CarbonSpark2SqlParser (57-962). The bar is 500 significant lines; this is 121 over it, 1.24× 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: rdd/CarbonScanRDD.scala integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala — FileTooLong — 620 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: CarbonScanRDD (78-908). The bar is 500 significant lines; this is 120 over it, 1.24× 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: optimizer/CarbonSecondaryIndexOptimizer.scala integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala — FileTooLong — 616 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: CarbonSecondaryIndexOptimizer (60-972). The bar is 500 significant lines; this is 116 over it, 1.23× 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: merge/CarbonMergeDataSetCommand.scala integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetCommand.scala — FileTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 105 over it, 1.21× 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.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×33
  • Duplicated block (7 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:87 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:87-95 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:135-141 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.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. 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) core/src/main/java/org/apache/carbondata/core/datastore/columnar/BlockIndexerStorage.java:95 — core/src/main/java/org/apache/carbondata/core/datastore/columnar/BlockIndexerStorage.java:95-101 | core/src/main/java/org/apache/carbondata/core/datastore/columnar/BlockIndexerStorage.java:105-111 — 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:436 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:436-442 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:466-472 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 125 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:436` 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) core/src/main/java/org/apache/carbondata/core/index/dev/expr/OrIndexExprWrapper.java:54 — core/src/main/java/org/apache/carbondata/core/index/dev/expr/OrIndexExprWrapper.java:54-60 | core/src/main/java/org/apache/carbondata/core/index/dev/expr/OrIndexExprWrapper.java:66-72 — 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 (7 lines × 2) core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/SegmentIndexFileStore.java:149 — core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/SegmentIndexFileStore.java:149-155 | core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/SegmentIndexFileStore.java:157-163 — 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 `core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/SegmentIndexFileStore.java:149` 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) core/src/main/java/org/apache/carbondata/core/metadata/schema/BucketingInfo.java:71 — core/src/main/java/org/apache/carbondata/core/metadata/schema/BucketingInfo.java:71-77 | core/src/main/java/org/apache/carbondata/core/metadata/schema/table/TableSchema.java:256-262 — 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 (7 lines × 2) geo/src/main/java/org/apache/carbondata/geo/GeoHashUtils.java:154 — geo/src/main/java/org/apache/carbondata/geo/GeoHashUtils.java:154-160 | geo/src/main/java/org/apache/carbondata/geo/QuadTreeCls.java:389-395 — 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 `geo/src/main/java/org/apache/carbondata/geo/GeoHashUtils.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 `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/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:150 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:150-156 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java:151-157 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java` as WHOLE FILES: this scan already matched 5 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. 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) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonCompactionUtil.java:636 — processing/src/main/java/org/apache/carbondata/processing/merger/CarbonCompactionUtil.java:636-642 | tools/cli/src/main/java/org/apache/carbondata/tool/FileCollector.java:194-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/carbondata/processing/merger/CarbonCompactionUtil.java:636` 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/carbondata/processing/util/CarbonDataProcessorUtil.java:406 — processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:406-412 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:425-431 — 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/carbondata/processing/util/CarbonDataProcessorUtil.java:406` 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 lines × 2) processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:451 — processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:451-457 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:478-484 — 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/carbondata/processing/util/CarbonDataProcessorUtil.java:451` 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 lines × 2) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:291 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:291-297 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:301-307 — 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 `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:291` 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 (7 lines × 2) streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:486 — streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:486-492 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:507-513 — 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 `streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:486` 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 (7 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/filesystem/AbstractDFSCarbonFile.java:271 — core/src/main/java/org/apache/carbondata/core/datastore/filesystem/AbstractDFSCarbonFile.java:271-277 | core/src/main/java/org/apache/carbondata/core/datastore/filesystem/LocalCarbonFile.java:273-279 — 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 × 2) core/src/main/java/org/apache/carbondata/core/scan/complextypes/ArrayQueryType.java:41 — core/src/main/java/org/apache/carbondata/core/scan/complextypes/ArrayQueryType.java:41-47 | processing/src/main/java/org/apache/carbondata/processing/datatypes/ArrayDataType.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `children` to `GenericQueryType` in one and `GenericDataType` 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 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/complextypes/StructQueryType.java:80 — core/src/main/java/org/apache/carbondata/core/scan/complextypes/StructQueryType.java:80-86 | processing/src/main/java/org/apache/carbondata/processing/datatypes/StructDataType.java:235-241 — 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 (7 lines × 2) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:216 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:216-222 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java:221-227 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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 × 2) core/src/main/java/org/apache/carbondata/core/metadata/datatype/ArrayType.java:64 — core/src/main/java/org/apache/carbondata/core/metadata/datatype/ArrayType.java:64-70 | core/src/main/java/org/apache/carbondata/core/metadata/datatype/StructType.java:58-64 — 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 × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:179 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:179-186 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.java:175-181 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.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. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:179` 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 `sortDataRows` to `SortDataRows` in one and `UnsafeSortDataRows` 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 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkReaderV3.java:129 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkReaderV3.java:129-135 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/measure/v3/MeasureChunkReaderV3.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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkReaderV3.java:129` 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, `core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkReaderV3.java:128` calls `fill` and `core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/measure/v3/MeasureChunkReaderV3.java:116` 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 (7 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:203 — core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:203-209 | core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeFixLengthColumnPage.java:224-230 — 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 (7 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:82 — core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:82-88 | core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:93-99 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:82` 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 (7 lines × 2) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:195 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:195-201 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:205-211 — 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 `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) integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/SparkCarbonFileFormat.scala:240 — integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/SparkCarbonFileFormat.scala:240-246 | integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/SparkCarbonFileFormat.scala:293-299 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/SparkCarbonFileFormat.scala:240` 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) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/IndexRepairCommand.scala:78 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/IndexRepairCommand.scala:78-84 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SILoadEventListener.scala:57-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. Read the line range as the matched WINDOW rather than a finished unit: at `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/IndexRepairCommand.scala:78` 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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×32
  • Duplicated block (10 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java:235 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java:235-244 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2311-2320 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java:235` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/EncodingFactory.java:180 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/EncodingFactory.java:180-189 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/EncodingFactory.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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/EncodingFactory.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.
  • Duplicated block (10 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:407 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:407-416 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:437-446 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 125 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:407` 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) core/src/main/java/org/apache/carbondata/core/metadata/converter/ThriftWrapperSchemaConverterImpl.java:495 — core/src/main/java/org/apache/carbondata/core/metadata/converter/ThriftWrapperSchemaConverterImpl.java:495-504 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2040-2049 — 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 (10 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/schema/table/IndexSchema.java:135 — core/src/main/java/org/apache/carbondata/core/metadata/schema/table/IndexSchema.java:135-144 | core/src/main/java/org/apache/carbondata/core/view/MVSchema.java:155-164 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/schema/table/IndexSchema.java:135` 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) core/src/main/java/org/apache/carbondata/core/reader/CarbonDeleteFilesDataReader.java:81 — core/src/main/java/org/apache/carbondata/core/reader/CarbonDeleteFilesDataReader.java:81-90 | core/src/main/java/org/apache/carbondata/core/reader/CarbonDeleteFilesDataReader.java:122-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `deltaFiles` to `String[]` in one and `List<String>` 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 × 2) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java:73 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java:73-82 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedDictionaryResultCollector.java:118-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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.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.
  • Duplicated block (10 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:258 — core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:258-267 | core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:411-420 — 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 `core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:258` 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 before the matched lines, `core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:409` calls `getTime` and `core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:258` 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 (10 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:239 — core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:239-248 | core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:431-440 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.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.
  • Duplicated block (10 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:248 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:248-257 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:331-340 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:248` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:349 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:349-358 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:425-434 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:349` 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, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:348` calls `flip` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:424` 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 (10 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:389 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:389-398 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:464-473 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:389` 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) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:971 — core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:971-980 | core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:1016-1025 — 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 `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:971` 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) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2618 — core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2618-2627 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2629-2638 — 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 `core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2618` 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) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:3164 — core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:3164-3173 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:3197-3206 — 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) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:356 — hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:356-365 | hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:540-549 — 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 `hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:356` 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) hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.java:109 — hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.java:109-118 | integration/spark/src/main/java/org/apache/carbondata/spark/vectorreader/VectorizedCarbonRecordReader.java:132-141 — 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 `hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.java:109` 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, `integration/spark/src/main/java/org/apache/carbondata/spark/vectorreader/VectorizedCarbonRecordReader.java:131` calls `getAllSplits` and `hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.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 (10 lines × 2) index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomIndexFileStore.java:174 — index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomIndexFileStore.java:174-183 | index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomIndexFileStore.java:215-224 — 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 `index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomIndexFileStore.java:174` 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) index/lucene/src/main/java/org/apache/carbondata/index/lucene/LuceneFineGrainIndex.java:365 — index/lucene/src/main/java/org/apache/carbondata/index/lucene/LuceneFineGrainIndex.java:365-374 | index/lucene/src/main/java/org/apache/carbondata/index/lucene/LuceneFineGrainIndex.java:403-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `index/lucene/src/main/java/org/apache/carbondata/index/lucene/LuceneFineGrainIndex.java:401` calls `get`, `numericValue`, `shortValue` and `index/lucene/src/main/java/org/apache/carbondata/index/lucene/LuceneFineGrainIndex.java:362` 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) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:58 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:58-67 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java:61-70 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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 `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:58` 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) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:110 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:110-119 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java:117-126 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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 (10 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java:139 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java:139-148 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMerger.java:135-144 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMerger.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 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) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:590 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:590-599 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:668-677 — 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/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:590` 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) core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:223 — core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:223-232 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1136-1145 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:223` 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 (10 lines × 2) processing/src/main/java/org/apache/carbondata/processing/merger/CompactionResultSortProcessor.java:368 — processing/src/main/java/org/apache/carbondata/processing/merger/CompactionResultSortProcessor.java:368-377 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/InMemorySortTempChunkHolder.java:145-154 — 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.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×32
  • Duplicated block (6 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/impl/VariableLengthDimensionColumnPage.java:116 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/impl/VariableLengthDimensionColumnPage.java:116-121 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/impl/VariableLengthDimensionColumnPage.java:140-145 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/chunk/impl/VariableLengthDimensionColumnPage.java:116` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:291 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:291-296 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:279-284 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:291` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:366 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:366-371 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:443-448 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:366` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:344 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:344-349 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:385-390 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 125 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:344` 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, `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:343` calls `getSizeInBytes` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:384` 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 (6 lines × 2) core/src/main/java/org/apache/carbondata/core/indexstore/row/UnsafeIndexRow.java:55 — core/src/main/java/org/apache/carbondata/core/indexstore/row/UnsafeIndexRow.java:55-60 | core/src/main/java/org/apache/carbondata/core/indexstore/row/UnsafeIndexRow.java:79-84 — 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 `core/src/main/java/org/apache/carbondata/core/indexstore/row/UnsafeIndexRow.java:55` 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, `core/src/main/java/org/apache/carbondata/core/indexstore/row/UnsafeIndexRow.java:61` calls `getBytePosition` and `core/src/main/java/org/apache/carbondata/core/indexstore/row/UnsafeIndexRow.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 (6 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:279 — core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:279-284 | core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:329-334 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.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 (6 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java:300 — core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java:300-305 | core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java:349-354 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java:300` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:206 — core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:206-213 | core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:234-239 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:206` 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 (6 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:175 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:175-180 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:259-264 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:175` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:239 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:239-244 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:322-327 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:238` calls `flip` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:321` 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 (6 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:327 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:327-332 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:408-413 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:327` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:296 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:296-301 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:353-358 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:296` 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) core/src/main/java/org/apache/carbondata/core/util/DataFileFooterConverter.java:72 — core/src/main/java/org/apache/carbondata/core/util/DataFileFooterConverter.java:72-77 | core/src/main/java/org/apache/carbondata/core/util/DataFileFooterConverterV3.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.
  • Duplicated block (6 lines × 2) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:615 — core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:615-620 | core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:663-668 — 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 `core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:615` 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 × 2) core/src/main/java/org/apache/carbondata/hadoop/internal/ObjectArrayWritable.java:46 — core/src/main/java/org/apache/carbondata/hadoop/internal/ObjectArrayWritable.java:46-51 | processing/src/main/java/org/apache/carbondata/processing/loading/csvinput/StringArrayWritable.java:50-55 — 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 `core/src/main/java/org/apache/carbondata/hadoop/internal/ObjectArrayWritable.java:46` 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 (6 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:291 — processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:291-296 | processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:356-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. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:291` 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/carbondata/processing/loading/converter/impl/FieldEncoderFactory.java:159 — processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/FieldEncoderFactory.java:159-164 | processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/FieldEncoderFactory.java:171-176 — 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/carbondata/processing/loading/converter/impl/FieldEncoderFactory.java:159` 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/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java:292 — processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java:292-297 | processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java:310-315 — 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/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java:292` 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/carbondata/processing/util/CarbonDataProcessorUtil.java:645 — processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:645-650 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:673-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/carbondata/processing/util/CarbonDataProcessorUtil.java:645` 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) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:226 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:226-231 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:417-422 — 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 `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:226` 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) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:236 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:236-241 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:430-435 — 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 `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:236` 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) core/src/main/java/org/apache/carbondata/core/index/dev/expr/AndIndexExprWrapper.java:96 — core/src/main/java/org/apache/carbondata/core/index/dev/expr/AndIndexExprWrapper.java:96-101 | core/src/main/java/org/apache/carbondata/core/index/dev/expr/OrIndexExprWrapper.java:87-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. 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) core/src/main/java/org/apache/carbondata/core/locks/HdfsFileLock.java:49 — core/src/main/java/org/apache/carbondata/core/locks/HdfsFileLock.java:49-54 | core/src/main/java/org/apache/carbondata/core/locks/S3FileLock.java:58-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.
  • Duplicated block (6 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/ColumnIdentifier.java:82 — core/src/main/java/org/apache/carbondata/core/metadata/ColumnIdentifier.java:82-87 | core/src/main/java/org/apache/carbondata/core/metadata/schema/table/column/CarbonDimension.java:103-108 — 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 (6 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepImpl.java:84 — processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepImpl.java:84-89 | processing/src/main/java/org/apache/carbondata/processing/loading/steps/JsonInputProcessorStepImpl.java:70-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. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepImpl.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.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×32
  • Duplicated block (5 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentProperties.java:373 — core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentProperties.java:373-377 | core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:400-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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentProperties.java:373` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/LVByteBufferColumnPage.java:58 — core/src/main/java/org/apache/carbondata/core/datastore/page/LVByteBufferColumnPage.java:58-62 | core/src/main/java/org/apache/carbondata/core/datastore/page/VarLengthColumnPageBase.java:55-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 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, `core/src/main/java/org/apache/carbondata/core/datastore/page/LVByteBufferColumnPage.java:63` calls `allocateDirect` and `core/src/main/java/org/apache/carbondata/core/datastore/page/VarLengthColumnPageBase.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 × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:189 — core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:189-193 | core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeVarLengthColumnPage.java:94-98 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:189` 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 (5 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:380 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:380-384 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:342-346 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:380` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:459 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:459-463 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:405-409 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:459` 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) core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:621 — core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:621-625 | core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:645-649 — 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 `core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:621` 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) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedVectorResultCollector.java:96 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedVectorResultCollector.java:96-100 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedVectorResultCollector.java:110-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 (5 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:200 — core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:200-204 | core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:228-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 `core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:200` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:303 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:303-307 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:360-364 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:303` 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) core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:297 — core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:297-301 | core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:316-321 — 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 `core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.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 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) geo/src/main/java/org/apache/carbondata/geo/GeoHashUtils.java:434 — geo/src/main/java/org/apache/carbondata/geo/GeoHashUtils.java:434-438 | geo/src/main/java/org/apache/carbondata/geo/scan/filter/executor/PolygonFilterExecutorImpl.java:50-54 — 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 `geo/src/main/java/org/apache/carbondata/geo/GeoHashUtils.java:434` 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/carbondata/processing/loading/converter/impl/MeasureFieldConverterImpl.java:72 — processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/MeasureFieldConverterImpl.java:72-76 | processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/MeasureFieldConverterImpl.java:84-88 — 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/carbondata/processing/loading/converter/impl/MeasureFieldConverterImpl.java:77` calls `getColumn`, `isDimension` and `processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/MeasureFieldConverterImpl.java:89` 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 × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:771 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:771-775 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:786-790 — 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/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:771` 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/carbondata/processing/util/CarbonDataProcessorUtil.java:355 — processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:355-359 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:704-708 — 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) streaming/src/main/java/org/apache/carbondata/streaming/StreamBlockletWriter.java:152 — streaming/src/main/java/org/apache/carbondata/streaming/StreamBlockletWriter.java:152-156 | streaming/src/main/java/org/apache/carbondata/streaming/StreamBlockletWriter.java:165-169 — 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 `streaming/src/main/java/org/apache/carbondata/streaming/StreamBlockletWriter.java:152` 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 `val` to `int` 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 (5 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:160 — core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:160-164 | core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeVarLengthColumnPage.java:64-68 — 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/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:162 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:162-166 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java:162-166 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java` as WHOLE FILES: this scan already matched 5 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.
  • Duplicated block (5 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:727 — core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:727-731 | core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:769-773 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:727` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:135 — core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:135-139 | core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeFixLengthColumnPage.java:140-144 — 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) core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:366 — core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:366-370 | core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:450-454 — 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 `core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:366` 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) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:63 — core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:63-67 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotInExpression.java:84-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:63` 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, `core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:69` calls `ExpressionResult`, `getDataType`, `getLong` and `core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotInExpression.java:90` 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) geo/src/main/java/org/apache/carbondata/geo/QuadTreeCls.java:208 — geo/src/main/java/org/apache/carbondata/geo/QuadTreeCls.java:208-212 | geo/src/main/java/org/apache/carbondata/geo/QuadTreeCls.java:226-230 — 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 `geo/src/main/java/org/apache/carbondata/geo/QuadTreeCls.java:208` 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 (5 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:805 — integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:805-809 | integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:841-845 — 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) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:322 — integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:322-326 | integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:335-339 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:322` 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) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:349 — integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:349-353 | integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:477-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. Read the line range as the matched WINDOW rather than a finished unit: at `integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:349` 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.
  • + 7 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×31
  • ClassTooLong: CarbonUtil core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:138 — ClassTooLong — 1975 significant lines (blank, comment-only and punctuation-only lines excluded), 137 methods. The bar is 400 significant lines; this is 1575 over it, 4.94× 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: CarbonProperties core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java:79 — ClassTooLong — 1395 significant lines (blank, comment-only and punctuation-only lines excluded), 119 methods. The bar is 400 significant lines; this is 995 over it, 3.49× 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: SegmentFileStore core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:83 — ClassTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. The bar is 400 significant lines; this is 489 over it, 2.22× 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: CarbonCommonConstants REDACTED:25 — ClassTooLong — 833 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 433 over it, 2.08× 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: SegmentStatusManager core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:70 — ClassTooLong — 831 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 431 over it, 2.08× 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: MVRewrite integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:54 — ClassTooLong — 784 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 384 over it, 1.96× 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: FilterUtil core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:97 — ClassTooLong — 751 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 351 over it, 1.88× 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: DataTypeUtil core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:55 — ClassTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 349 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.
  • ClassTooLong: CarbonLoaderUtil processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:65 — ClassTooLong — 693 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 293 over it, 1.73× 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: CarbonTable core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:79 — ClassTooLong — 648 significant lines (blank, comment-only and punctuation-only lines excluded), 96 methods. The bar is 400 significant lines; this is 248 over it, 1.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: BlockIndex core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java:80 — ClassTooLong — 600 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 200 over it, 1.50× 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: CarbonSpark2SqlParser integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala:57 — ClassTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 191 over it, 1.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: CarbonWriterBuilder sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:70 — ClassTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 188 over it, 1.47× 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: CarbonSecondaryIndexOptimizer integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:60 — ClassTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 180 over it, 1.45× 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: CarbonDataMergerUtil processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:71 — ClassTooLong — 578 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 178 over it, 1.45× 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: CarbonScanRDD integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:78 — ClassTooLong — 570 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 170 over it, 1.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.
  • ClassTooLong: ColumnPage core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:48 — ClassTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded), 87 methods. The bar is 400 significant lines; this is 153 over it, 1.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: CarbonMergerRDD integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:72 — ClassTooLong — 527 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 127 over it, 1.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: CarbonInputFormat hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java:99 — ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 104 over it, 1.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: SortParameters processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:40 — ClassTooLong — 496 significant lines (blank, comment-only and punctuation-only lines excluded), 88 methods. The bar is 400 significant lines; this is 96 over it, 1.24× 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: CarbonInputSplit core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:61 — ClassTooLong — 489 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 89 over it, 1.22× 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: BlockletIndexFactory core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndexFactory.java:81 — ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 74 over it, 1.19× 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: CarbonDataProcessorUtil processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:62 — ClassTooLong — 463 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 63 over it, 1.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: SortStepRowHandler processing/src/main/java/org/apache/carbondata/processing/loading/sort/SortStepRowHandler.java:49 — ClassTooLong — 463 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 63 over it, 1.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: ThriftWrapperSchemaConverterImpl core/src/main/java/org/apache/carbondata/core/metadata/converter/ThriftWrapperSchemaConverterImpl.java:46 — ClassTooLong — 434 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 34 over it, 1.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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×31
  • Duplicated block (8 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/AbstractDimensionChunkReader.java:120 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/AbstractDimensionChunkReader.java:120-127 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/measure/AbstractMeasureChunkReader.java:102-109 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/AbstractDimensionChunkReader.java:120` 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) core/src/main/java/org/apache/carbondata/core/datastore/columnar/ByteArrayBlockIndexerStorage.java:58 — core/src/main/java/org/apache/carbondata/core/datastore/columnar/ByteArrayBlockIndexerStorage.java:58-65 | core/src/main/java/org/apache/carbondata/core/datastore/columnar/ObjectArrayBlockIndexerStorage.java:58-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 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `dataPage` to `byte[][]` in one and `Object[]` 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 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:443 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:443-450 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:536-543 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 125 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.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 (8 lines × 2) core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java:408 — core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java:408-415 | core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndex.java:173-180 — 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) core/src/main/java/org/apache/carbondata/core/memory/UnsafeMemoryManager.java:160 — core/src/main/java/org/apache/carbondata/core/memory/UnsafeMemoryManager.java:160-167 | core/src/main/java/org/apache/carbondata/core/memory/UnsafeSortMemoryManager.java:148-155 — 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 `core/src/main/java/org/apache/carbondata/core/memory/UnsafeMemoryManager.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.
  • Duplicated block (8 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:198 — core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:198-205 | core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:762-769 — 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) core/src/main/java/org/apache/carbondata/core/metadata/schema/table/IndexSchema.java:161 — core/src/main/java/org/apache/carbondata/core/metadata/schema/table/IndexSchema.java:161-168 | core/src/main/java/org/apache/carbondata/core/view/MVSchema.java:174-181 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/schema/table/IndexSchema.java:161` 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 × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:311 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:311-318 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:396-403 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:311` 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) core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:284 — core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:284-291 | core/src/main/java/org/apache/carbondata/core/util/ByteUtil.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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:284` 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) core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:471 — core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:471-478 | core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:562-569 — 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 `val` to `int` 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 lines × 2) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1883 — core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1883-1890 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1928-1935 — 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 `core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1883` 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) core/src/main/java/org/apache/carbondata/core/util/DataFileFooterConverter.java:58 — core/src/main/java/org/apache/carbondata/core/util/DataFileFooterConverter.java:58-65 | core/src/main/java/org/apache/carbondata/core/util/DataFileFooterConverter.java:114-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 `core/src/main/java/org/apache/carbondata/core/util/DataFileFooterConverter.java:58` 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) hadoop/src/main/java/org/apache/carbondata/hadoop/CarbonRecordReader.java:94 — hadoop/src/main/java/org/apache/carbondata/hadoop/CarbonRecordReader.java:94-101 | hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.java:99-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 `hadoop/src/main/java/org/apache/carbondata/hadoop/CarbonRecordReader.java:94` 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 × 2) integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java:339 — integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java:339-346 | integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java:354-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. Read the line range as the matched WINDOW rather than a finished unit: at `integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.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.
  • Duplicated block (8 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/DirectDictionaryFieldConverterImpl.java:88 — processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/DirectDictionaryFieldConverterImpl.java:88-95 | processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/NonDictionaryFieldConverterImpl.java:104-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/carbondata/processing/loading/converter/impl/DirectDictionaryFieldConverterImpl.java:88` 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/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:94 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:94-101 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.java:88-95 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.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. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:94` 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/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.java:87` calls `getInstance`, `getSortMemoryChunkSizeInMB` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:93` 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/carbondata/processing/merger/CarbonDataMergerUtil.java:540 — processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:540-547 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:653-660 — 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/carbondata/processing/merger/CarbonDataMergerUtil.java:540` 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/carbondata/processing/sort/sortdata/SortParameters.java:577 — processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:577-584 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:727-734 — 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/carbondata/processing/sort/sortdata/SortParameters.java:725` calls `setNoDictSchemaDataType`, `getNoDictDataTypes` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:576` 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 × 2) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:358 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:358-365 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:371-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 `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:358` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:101 — core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:101-108 | core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeVarLengthColumnPage.java:71-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.
  • Duplicated block (8 lines × 2) core/src/main/java/org/apache/carbondata/core/index/dev/expr/AndIndexExprWrapper.java:85 — core/src/main/java/org/apache/carbondata/core/index/dev/expr/AndIndexExprWrapper.java:85-92 | core/src/main/java/org/apache/carbondata/core/index/dev/expr/OrIndexExprWrapper.java:100-107 — 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 (8 lines × 2) geo/src/main/java/org/apache/carbondata/geo/QuadTreeCls.java:862 — geo/src/main/java/org/apache/carbondata/geo/QuadTreeCls.java:862-871 | geo/src/main/java/org/apache/carbondata/geo/scan/expression/PolygonRangeListExpression.java:95-102 — 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) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:138 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:138-145 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java:145-152 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java:272 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java:272-279 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMerger.java:269-276 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMerger.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 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/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:211 — processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:211-218 | processing/src/main/java/org/apache/carbondata/processing/loading/steps/JsonInputProcessorStepImpl.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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×29
  • Duplicated block (9 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/filesystem/LocalCarbonFile.java:90 — core/src/main/java/org/apache/carbondata/core/datastore/filesystem/LocalCarbonFile.java:90-98 | core/src/main/java/org/apache/carbondata/core/datastore/filesystem/LocalCarbonFile.java:155-163 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/filesystem/LocalCarbonFile.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 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java:246 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java:246-254 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2322-2330 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.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. 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) core/src/main/java/org/apache/carbondata/core/memory/UnsafeMemoryManager.java:172 — core/src/main/java/org/apache/carbondata/core/memory/UnsafeMemoryManager.java:172-180 | core/src/main/java/org/apache/carbondata/core/memory/UnsafeSortMemoryManager.java:160-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 `core/src/main/java/org/apache/carbondata/core/memory/UnsafeMemoryManager.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 (9 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:51 — core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:51-59 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotInExpression.java:72-80 — 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 `core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:51` 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) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:74 — core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:74-82 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotInExpression.java:95-104 — 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 `core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:74` 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, `core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotInExpression.java:94` calls `ExpressionResult`, `getDataType`, `getLong` and `core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:73` 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) core/src/main/java/org/apache/carbondata/core/scan/expression/logical/AndExpression.java:40 — core/src/main/java/org/apache/carbondata/core/scan/expression/logical/AndExpression.java:40-48 | core/src/main/java/org/apache/carbondata/core/scan/expression/logical/RangeExpression.java:47-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/scan/expression/logical/AndExpression.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 (9 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:69 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:69-77 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:69-77 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:69` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:448 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:448-456 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:444-452 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:448` 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) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2203 — core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2203-2211 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2261-2269 — 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 `core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2203` 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.
  • Duplicated block (9 lines × 2) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:206 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:206-214 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java:211-219 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:101 — integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:101-109 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:168-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 `integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.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 (9 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:299 — processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:299-307 | processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:339-347 — 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/carbondata/processing/loading/DataLoadProcessBuilder.java:348` calls `size`, `contains`, `getColumnSchema` and `processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:308` 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 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:89 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:89-97 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java:86-94 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java` as WHOLE FILES: this scan already matched 5 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 `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:89` 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/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:152 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:152-160 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java:167-175 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 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/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:152` 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/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:151` calls `info` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java:166` 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 (9 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java:84 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java:84-92 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMerger.java:80-88 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMerger.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 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 (9 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateMerger.java:103 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateMerger.java:103-111 | REDACTED:68-76 — 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 (9 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateMerger.java:191 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateMerger.java:191-199 | REDACTED:110-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. 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, `REDACTED:106` calls `checkForFailure` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateMerger.java:187` 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 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:111 — core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeDecimalColumnPage.java:111-119 | core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeVarLengthColumnPage.java:48-56 — 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) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1204 — core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1204-1212 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonCompactionUtil.java:351-359 — 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 `core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1204` 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 × 2) processing/src/main/java/org/apache/carbondata/processing/datatypes/ArrayDataType.java:297 — processing/src/main/java/org/apache/carbondata/processing/datatypes/ArrayDataType.java:297-305 | processing/src/main/java/org/apache/carbondata/processing/datatypes/StructDataType.java:324-332 — 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 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:136 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:136-144 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java:151-160 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 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 (9 lines × 2) core/src/main/java/org/apache/carbondata/core/reader/CarbonFooterReader.java:47 — core/src/main/java/org/apache/carbondata/core/reader/CarbonFooterReader.java:47-55 | core/src/main/java/org/apache/carbondata/core/reader/CarbonFooterReaderV3.java:47-56 — 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 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:256 — integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:256-265 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/rdd/CarbonSIRebuildRDD.scala:262-270 — 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 `integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:256` 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) integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/CarbonFileIndex.scala:99 — integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/CarbonFileIndex.scala:99-107 | integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/SparkCarbonFileFormat.scala:364-372 — 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) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:264 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:264-272 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:705-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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:264` 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×22
  • Duplicated block (12 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkPageReaderV3.java:78 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkPageReaderV3.java:78-89 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkReaderV3.java:96-107 — 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 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:109 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:109-120 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:158-169 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:109` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/VarLengthColumnPageBase.java:186 — core/src/main/java/org/apache/carbondata/core/datastore/page/VarLengthColumnPageBase.java:186-197 | core/src/main/java/org/apache/carbondata/core/datastore/page/VarLengthColumnPageBase.java:212-223 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/VarLengthColumnPageBase.java:186` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:321 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:321-332 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:308-319 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:321` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/KeyPageStatsCollector.java:82 — core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/KeyPageStatsCollector.java:82-93 | core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/StringStatsCollector.java:98-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 `core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/KeyPageStatsCollector.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 (12 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:548 — core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:548-559 | core/src/main/java/org/apache/carbondata/core/view/MVProvider.java:312-323 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:548` 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, `core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:560` calls `flush` and `core/src/main/java/org/apache/carbondata/core/view/MVProvider.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 (12 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:177 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:177-188 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:344-355 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 256 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.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. 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:415 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:415-426 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:391-402 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 21 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:415` 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) core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:579 — core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:579-590 | core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:644-655 — 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 `core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:579` 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/carbondata/processing/loading/parser/impl/ArrayParserImpl.java:62 — processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/ArrayParserImpl.java:62-73 | processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/MapParserImpl.java:65-76 — 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/carbondata/processing/loading/parser/impl/ArrayParserImpl.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 (12 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/JsonRowParser.java:89 — processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/JsonRowParser.java:89-100 | processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/JsonRowParser.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. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/JsonRowParser.java:89` 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 `column` to `CarbonColumn` in one and `CarbonDimension` 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) processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:173 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:173-184 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java:173-184 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java` as WHOLE FILES: this scan already matched 5 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 `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:173` 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 `sortDataRows` to `SortDataRows[]` in one and `UnsafeSortDataRows[]` 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) processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:541 — processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:541-552 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:612-623 — 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/carbondata/processing/util/CarbonDataProcessorUtil.java:541` 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 (12 lines × 2) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:208 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:208-219 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:479-490 — 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 `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:208` 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) core/src/main/java/org/apache/carbondata/core/locks/HdfsFileLock.java:83 — core/src/main/java/org/apache/carbondata/core/locks/HdfsFileLock.java:83-94 | core/src/main/java/org/apache/carbondata/core/locks/S3FileLock.java:69-80 — 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 (12 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:302 — integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:302-313 | integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:326-337 — 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 `integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala: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 (12 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CompactionTaskCompletionListener.scala:47 — integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CompactionTaskCompletionListener.scala:47-58 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/rdd/CarbonSIRebuildRDD.scala:273-284 — 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, `integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CompactionTaskCompletionListener.scala:60` calls `fillSegmentMetaDataInfoToAccumulator` and `integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/rdd/CarbonSIRebuildRDD.scala:285` 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 (12 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala:203 — integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala:203-214 | integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala:220-231 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala:203` 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) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForDeleteCommand.scala:185 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForDeleteCommand.scala:185-196 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForUpdateCommand.scala:251-262 — 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 lines × 2) mv/plan/src/main/common2.3and2.4/org/apache/carbondata/mv/plans/modular/SparkVersionHelper.scala:36 — mv/plan/src/main/common2.3and2.4/org/apache/carbondata/mv/plans/modular/SparkVersionHelper.scala:36-47 | mv/plan/src/main/spark3.1/org/apache/carbondata/mv/plans/modular/SparkVersionHelper.scala:35-46 — 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 lines × 2) examples/spark/src/main/scala/org/apache/carbondata/examples/CDCExample.scala:276 — examples/spark/src/main/scala/org/apache/carbondata/examples/CDCExample.scala:276-287 | examples/spark/src/main/scala/org/apache/carbondata/examples/DedupExample.scala:188-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.
  • Duplicated block (12 lines × 2) REDACTED:139 — REDACTED:139-150 | REDACTED:138-149 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×22
  • Duplicated block (11 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentProperties.java:399 — core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentProperties.java:399-409 | core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:429-439 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentProperties.java:399` 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) core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:227 — core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:227-237 | core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:378-388 — 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 `core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:227` 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) core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java:394 — core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java:394-404 | core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndex.java:160-170 — 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 × 2) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:48 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:48-58 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:54-64 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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) core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.java:127 — core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.java:127-137 | core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.java:148-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 `core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.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.
  • Duplicated block (11 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:275 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:275-285 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:263-273 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 266 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:275` 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 (11 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:458 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:458-468 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:454-464 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:458` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:332 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:332-342 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:266-276 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 256 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:332` 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 (11 lines × 2) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:354 — core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:354-364 | core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:847-857 — 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 `core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.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.
  • Duplicated block (11 lines × 2) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:365 — core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:365-375 | core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:859-869 — 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 `core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:365` 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/carbondata/processing/loading/steps/CarbonRowDataWriterProcessorStepImpl.java:415 — processing/src/main/java/org/apache/carbondata/processing/loading/steps/CarbonRowDataWriterProcessorStepImpl.java:415-425 | processing/src/main/java/org/apache/carbondata/processing/loading/steps/DataWriterProcessorStepImpl.java:255-265 — 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/carbondata/processing/loading/steps/CarbonRowDataWriterProcessorStepImpl.java:415` 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) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonCompactionUtil.java:614 — processing/src/main/java/org/apache/carbondata/processing/merger/CarbonCompactionUtil.java:614-624 | tools/cli/src/main/java/org/apache/carbondata/tool/FileCollector.java:170-180 — 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/carbondata/processing/merger/CarbonCompactionUtil.java:614` 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. Note first that the copies are not typed on the same thing: `ColumnSchema` names `org.apache.carbondata.core.metadata.schema.table.column.ColumnSchema` in one and `org.apache.carbondata.format.ColumnSchema` 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 (11 lines × 2) streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:74 — streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:74-84 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:144-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 `streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.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.
  • Duplicated block (11 lines × 2) core/src/main/java/org/apache/carbondata/core/readcommitter/LatestFilesReadCommittedScope.java:120 — core/src/main/java/org/apache/carbondata/core/readcommitter/LatestFilesReadCommittedScope.java:120-130 | core/src/main/java/org/apache/carbondata/core/readcommitter/TableStatusReadCommittedScope.java:75-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.
  • Duplicated block (11 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkPageReaderV3.java:120 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkPageReaderV3.java:120-130 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/measure/v3/MeasureChunkPageReaderV3.java:119-129 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkPageReaderV3.java:120` 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 `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) core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:531 — core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:531-541 | integration/hive/src/main/java/org/apache/carbondata/hive/CarbonHiveInputSplit.java:272-283 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:545` calls `deserializeField` and `integration/hive/src/main/java/org/apache/carbondata/hive/CarbonHiveInputSplit.java:287` 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) integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:135 — integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:135-145 | integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:158-168 — before extracting anything, compare `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala` and `integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala` as WHOLE FILES: this scan already matched 3 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 `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:135` 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) integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:77 — integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:77-87 | integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:107-117 — 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 `integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala: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 (11 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:586 — integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:586-596 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/rdd/CarbonSecondaryIndexRDD.scala:257-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. Read the line range as the matched WINDOW rather than a finished unit: at `integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:586` 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) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:296 — integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:296-306 | integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:355-365 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala: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.
  • Duplicated block (11 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:851 — integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:851-861 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:878-888 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala: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.
  • Duplicated block (11 lines × 2) REDACTED:154 — REDACTED:154-164 | REDACTED:153-163 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 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 `REDACTED: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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×18
  • Duplicated block (13 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/measure/v3/MeasureChunkPageReaderV3.java:76 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/measure/v3/MeasureChunkPageReaderV3.java:76-88 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/measure/v3/MeasureChunkReaderV3.java:82-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.
  • Duplicated block (13 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/filesystem/AbstractDFSCarbonFile.java:249 — core/src/main/java/org/apache/carbondata/core/datastore/filesystem/AbstractDFSCarbonFile.java:249-261 | core/src/main/java/org/apache/carbondata/core/datastore/filesystem/LocalCarbonFile.java:251-263 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/filesystem/AbstractDFSCarbonFile.java:249` 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 (13 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:287 — core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:287-299 | core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:344-356 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:287` 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 (13 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:366 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:366-378 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:340-352 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 266 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:366` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:64 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:64-76 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:64-76 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 401 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:64` 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) core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:514 — core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:514-526 | integration/hive/src/main/java/org/apache/carbondata/hive/CarbonHiveInputSplit.java:252-264 — 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 `core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:514` 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) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:123 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:123-135 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java:130-142 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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 (13 lines × 2) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:286 — integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:286-298 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:196-208 — 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 `integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:286` 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 × 2) REDACTED:115 — REDACTED:115-127 | REDACTED:147-160 — 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 `REDACTED: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 (13 lines × 2) processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:497 — processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:497-509 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:677-689 — 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/carbondata/processing/store/CarbonFactDataHandlerModel.java:190 — processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerModel.java:190-202 | processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerModel.java:352-364 — 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/carbondata/processing/util/CarbonDataProcessorUtil.java:528 — processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:528-540 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:599-611 — 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/carbondata/processing/util/CarbonDataProcessorUtil.java:528` 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) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:1062 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:1062-1074 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:1076-1088 — 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) streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:100 — streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:100-112 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:163-175 — 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 `streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:100` 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 (13 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:341 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:341-353 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java:351-363 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 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 (13 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:564 — integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:564-576 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:609-622 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:564` 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) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/SQLBuildDSL.scala:322 — mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/SQLBuildDSL.scala:322-334 | mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/SQLBuildDSL.scala:348-360 — 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) integration/spark/src/main/common2.4and3.1/org/apache/spark/sql/CarbonBoundReference.scala:32 — integration/spark/src/main/common2.4and3.1/org/apache/spark/sql/CarbonBoundReference.scala:32-44 | integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonBoundReference.scala:32-44 — before extracting anything, compare `integration/spark/src/main/common2.4and3.1/org/apache/spark/sql/CarbonBoundReference.scala` and `integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonBoundReference.scala` 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. 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×17
  • Duplicated block (14 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java:75 — core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java:75-88 | core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java:111-124 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java:75` 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 `meta` to `ColumnPageEncoderMeta` in one and `ValueEncoderMeta` 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 (14 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/converter/ThriftWrapperSchemaConverterImpl.java:624 — core/src/main/java/org/apache/carbondata/core/metadata/converter/ThriftWrapperSchemaConverterImpl.java:624-637 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2070-2083 — 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:306 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:306-319 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:302-315 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 401 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 (14 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:287 — core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:287-300 | core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:580-593 — 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 `core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.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 (14 lines × 2) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:184 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:184-197 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java:189-202 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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 `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:184` 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) integration/presto/src/main/java/org/apache/carbondata/presto/PrestoCarbonVectorizedRecordReader.java:99 — integration/presto/src/main/java/org/apache/carbondata/presto/PrestoCarbonVectorizedRecordReader.java:99-112 | integration/spark/src/main/java/org/apache/carbondata/spark/vectorreader/VectorizedCarbonRecordReader.java:124-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.
  • Duplicated block (14 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/SortStepRowHandler.java:209 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/SortStepRowHandler.java:209-222 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/SortStepRowHandler.java:244-257 — 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/carbondata/processing/loading/sort/SortStepRowHandler.java:260` calls `unpackNoSortFromBytes` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/SortStepRowHandler.java:224` 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 × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:733 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:733-746 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:862-875 — 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/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:733` 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/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:730` calls `newKey` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:860` 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 × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:796 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:796-809 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:925-938 — 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/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:796` 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) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:858 — core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:858-871 | core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:574-587 — 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 (14 lines × 2) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriterFactoryBuilder.java:39 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriterFactoryBuilder.java:39-52 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3WriterFactoryBuilder.java:39-52 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriterFactoryBuilder.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3WriterFactoryBuilder.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 `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriterFactoryBuilder.java:39` 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 (14 lines × 2) integration/spark/src/main/java/org/apache/carbondata/converter/SparkDataTypeConverterImpl.java:119 — integration/spark/src/main/java/org/apache/carbondata/converter/SparkDataTypeConverterImpl.java:119-132 | integration/spark/src/main/java/org/apache/carbondata/spark/util/Util.java:65-78 — 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 `integration/spark/src/main/java/org/apache/carbondata/converter/SparkDataTypeConverterImpl.java:119` 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 (14 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:81 — integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:81-94 | integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:197-210 — 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 `integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:211` calls `convert` and `integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:95` 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) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:565 — integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:565-578 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/rdd/CarbonSecondaryIndexRDD.scala:239-252 — 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) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/NewCarbonDataLoadRDD.scala:173 — integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/NewCarbonDataLoadRDD.scala:173-186 | integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/NewCarbonDataLoadRDD.scala:329-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 `integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/NewCarbonDataLoadRDD.scala: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 (14 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:202 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:202-215 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:109-122 — before extracting anything, compare `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala` and `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala` 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. 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:202` 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) integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:216 — integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:216-229 | integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala:258-271 — before extracting anything, compare `integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala` and `integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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.
D3 · God Classes · MethodTooLong · ×13
  • MethodTooLong: 1.fillPrimitiveType core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:328 — MethodTooLong — fillPrimitiveType 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.
  • MethodTooLong: 1.fillVector core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:327 — MethodTooLong — fillVector runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× 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: AbstractQueryExecutor.getBlockExecutionInfoForBlock core/src/main/java/org/apache/carbondata/core/scan/executor/impl/AbstractQueryExecutor.java:435 — MethodTooLong — getBlockExecutionInfoForBlock runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× 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: StreamRecordReader.readRowFromStream hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:355 — MethodTooLong — readRowFromStream runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× 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: TableIndex.pruneMultiThread core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:277 — MethodTooLong — pruneMultiThread runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: CarbonLoadModelBuilder.build processing/src/main/java/org/apache/carbondata/processing/loading/model/CarbonLoadModelBuilder.java:147 — MethodTooLong — build runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× 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: DriverQueryStatisticsRecorderImpl.collectDriverStatistics core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:138 — MethodTooLong — collectDriverStatistics runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.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: 1.fillVector core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:302 — MethodTooLong — fillVector runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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: CarbonLoaderUtil.recordNewLoadMetadata processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:234 — MethodTooLong — recordNewLoadMetadata runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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: RowLevelFilterExecutorImpl.applyFilter core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:196 — MethodTooLong — applyFilter runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× 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: SortParameters.createSortParameters processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:471 — MethodTooLong — createSortParameters runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× 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: BlockletFilterScanner.executeFilter core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:172 — MethodTooLong — executeFilter runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.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: LoadOption.fillOptionWithDefaultValue processing/src/main/java/org/apache/carbondata/processing/loading/model/LoadOption.java:55 — MethodTooLong — fillOptionWithDefaultValue runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.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.
D30 · Dependency Vulnerabilities · Medium CVE · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×13
  • Duplicated block (18 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/SafeVariableLengthDimensionDataChunkStore.java:127 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/SafeVariableLengthDimensionDataChunkStore.java:127-144 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/SafeVariableLengthDimensionDataChunkStore.java:154-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.
  • Duplicated block (18 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:418 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:418-435 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:448-465 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 125 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:418` 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) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java:138 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java:138-155 | core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:205-222 — 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 `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.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. 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:181 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:181-198 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:239-256 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:181` 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 (18 lines × 2) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:466 — core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:466-483 | core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:568-585 — 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 `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.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 (18 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/RowConverterImpl.java:88 — processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/RowConverterImpl.java:88-105 | processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/RowConverterImpl.java:179-196 — 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/carbondata/processing/loading/converter/impl/RowConverterImpl.java:87` calls `currentTimeMillis` and `processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/RowConverterImpl.java:178` 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 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:190 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:190-207 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.java:185-202 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.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. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:190` 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 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeSingleThreadFinalSortFilesMerger.java:166 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeSingleThreadFinalSortFilesMerger.java:166-183 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SingleThreadFinalSortFilesMerger.java:142-159 — 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/carbondata/processing/loading/sort/unsafe/merger/UnsafeSingleThreadFinalSortFilesMerger.java:166` 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 (18 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:380 — integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:380-397 | integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:438-455 — 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 `integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:380` 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) python/pycarbon/core/carbon_tf_utils.py:142 — python/pycarbon/core/carbon_tf_utils.py:142-159 | python/pycarbon/integration/tensorflow.py:142-159 — before extracting anything, compare `python/pycarbon/core/carbon_tf_utils.py` and `python/pycarbon/integration/tensorflow.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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 (18 lines × 2) python/pycarbon/reader.py:83 — python/pycarbon/reader.py:83-100 | python/pycarbon/reader.py:127-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 `python/pycarbon/reader.py:83` 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) python/pycarbon/core/carbon_tf_utils.py:202 — python/pycarbon/core/carbon_tf_utils.py:202-219 | python/pycarbon/integration/tensorflow.py:199-216 — before extracting anything, compare `python/pycarbon/core/carbon_tf_utils.py` and `python/pycarbon/integration/tensorflow.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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 `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 (18 lines × 2) REDACTED:92 — REDACTED:92-109 | REDACTED:89-106 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 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 `REDACTED:92` 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, `REDACTED:90` calls `addSparkListener`, `CarbonSparkStreamingListener` and `REDACTED:87` 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×9
  • Duplicated block (9–10 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java:200 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java:200-209 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/dimension/legacy/IndexStorageEncoder.java:86-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.
  • Duplicated block (9–10 lines × 2) core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:251 — core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:251-259 | core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:407-416 — 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–10 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:646 — core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:646-654 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:249-258 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:646` 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 (9–10 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:218 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:218-227 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:236-244 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:218` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:243 — core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:243-252 | core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:265-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 `core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:243` 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 (9–10 lines × 2) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/RowComparator.java:59 — integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/RowComparator.java:59-68 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/NewRowComparator.java:52-60 — 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 `integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/RowComparator.java:59` 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) processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/JsonRowParser.java:108 — processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/JsonRowParser.java:108-117 | processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/JsonRowParser.java:150-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 `processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/JsonRowParser.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. 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) REDACTED:182 — REDACTED:182-190 | REDACTED: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.
  • Duplicated block (9–10 lines × 2) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:244 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:244-253 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:438-446 — 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 `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
  • Members sharing a duplicated core (4 members, 50+ identical tokens) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:82 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:82-123 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:89-130 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:70-111 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:67-107 — 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:198 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:198-210 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:213-227 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:230-244 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:247-261 — 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:176 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:176-188 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:191-205 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:208-220 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:223-237 — 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:346 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:346-367 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:370-411 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:423-443 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:446-486 — 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:82 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:82-113 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:82-115 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:81-113 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:81-113 — 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:117 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:117-151 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:119-153 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:117-150 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:117-150 — 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:174 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:174-198 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:232-256 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:173-197 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:173-195 — 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) REDACTED:184 — REDACTED:184-208 | REDACTED:182-206 | REDACTED:188-212 | REDACTED:177-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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×8
  • Duplicated block (10–11 lines × 2) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:382 — core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:382-391 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:422-432 — 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 `core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.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.
  • Duplicated block (10–11 lines × 2) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1557 — core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1557-1566 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1571-1581 — 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–11 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:335 — processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:335-344 | processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:349-359 — 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/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:335` 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–11 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:90 — integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:90-99 | integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:327-337 — 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–11 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala:423 — integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala:423-432 | integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala:476-486 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala:423` 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–11 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:357 — integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:357-367 | integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:486-495 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:357` 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–11 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SILoadEventListener.scala:52 — integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SILoadEventListener.scala:52-61 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SILoadEventListenerForFailedSegments.scala:55-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SILoadEventListener.scala:52` 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, `integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SILoadEventListenerForFailedSegments.scala:51` calls `getInstance`, `isSIRepairEnabled` and `integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SILoadEventListener.scala:49` 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 (10–11 lines × 2) REDACTED:47 — REDACTED:47-57 | REDACTED:78-87 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×7
  • Members sharing a duplicated core (5 members, 50+ identical tokens) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:179 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:179-192 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:202-215 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:225-238 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:248-263 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:273-286 — 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:254 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:254-332 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:312-325 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:244-319 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:286-300 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:250-310 — 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) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedVectorResultCollector.java:163 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedVectorResultCollector.java:163-192 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:69-113 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedVectorResultCollector.java:105-131 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:75-119 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRestructureBasedRawResultCollector.java:47-91 — 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) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanEqualToExpression.java:37 — core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanEqualToExpression.java:37-77 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanExpression.java:38-79 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/LessThanEqualToExpression.java:37-77 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/LessThanExpression.java:38-81 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/StartsWithExpression.java:38-63 — 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:577 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:577-602 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:577-596 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:584-603 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:595-614 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:603-622 — 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) examples/spark/src/main/scala/org/apache/carbondata/examples/CustomCompactionExample.scala:41 — examples/spark/src/main/scala/org/apache/carbondata/examples/CustomCompactionExample.scala:41-99 | examples/spark/src/main/scala/org/apache/carbondata/examples/DataManagementExample.scala:35-112 | REDACTED:41-103 | examples/spark/src/main/scala/org/apache/carbondata/examples/QuerySegmentExample.scala:41-148 | examples/spark/src/main/scala/org/apache/carbondata/examples/TableLevelCompactionOptionExample.scala:37-123 — 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) examples/spark/src/main/scala/org/apache/carbondata/examples/DataFrameComplexTypeExample.scala:48 — examples/spark/src/main/scala/org/apache/carbondata/examples/DataFrameComplexTypeExample.scala:48-160 | REDACTED:43-122 | REDACTED:39-122 | REDACTED:34-127 | REDACTED:33-124 — 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 · Duplicated block (15 lines × 2) · ×7
  • Duplicated block (15 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:426 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:426-440 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:598-612 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:426` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:360 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:360-374 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:356-370 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 401 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:360` 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 (15 lines × 2) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:553 — core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:553-567 | core/src/main/java/org/apache/carbondata/core/view/MVProvider.java:322-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 `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:553` 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) core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java:75 — core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java:75-89 | core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java:119-133 — 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 `core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java:75` 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) integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java:72 — integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java:72-86 | integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java:160-174 — 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 (15 lines × 2) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:192 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:192-206 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:463-477 — 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 `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.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 (15 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala:553 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala:553-567 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala:616-630 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala:553` 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×7
  • Duplicated block (10 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:146 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:146-155 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:157-166 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRestructureBasedRawResultCollector.java:129-138 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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 (10 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:125 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:125-134 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:140-149 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:220-229 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:125` 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, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:137` calls `decodeAllColumnPages` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:151` 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 × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:211 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:211-220 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:364-373 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:175-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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:209` calls `getFilterKeys` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:362` 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 (10 lines × 3) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:554 — core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:554-563 | core/src/main/java/org/apache/carbondata/core/view/MVProvider.java:323-332 | hadoop/src/main/java/org/apache/carbondata/hadoop/testutil/StoreCreator.java:391-400 — 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 `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:554` 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 × 3) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:267 — integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:267-276 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:74-83 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:144-153 — 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 `integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.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.
  • Duplicated block (10 lines × 3) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:587 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:587-596 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:694-703 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:793-802 — 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. 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) integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:65 — integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:65-74 | integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala:99-108 | integration/spark/src/main/spark3.1/org/apache/spark/sql/CarbonToSparkAdapter.scala:99-108 — before extracting anything, compare `integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala` and `integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×6
  • Duplicated block (11–12 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:97 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:97-107 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:144-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 `core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.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. 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–12 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:77 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:77-87 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:79-90 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:77` 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, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:92` calls `getComparatorByDataTypeForMeasure`, `getMeasureDataType` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:88` 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–12 lines × 2) core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:187 — core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:187-198 | core/src/main/java/org/apache/carbondata/hadoop/CarbonInputSplit.java:353-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.
  • Duplicated block (11–12 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:175 — integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:175-186 | integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:269-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 `integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:175` 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–12 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:525 — integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala:525-535 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/util/SecondaryIndexUtil.scala:750-761 — 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 (11–12 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/hive/CarbonInternalMetastore.scala:224 — integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/hive/CarbonInternalMetastore.scala:224-234 | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/hive/CarbonInternalMetastore.scala:238-249 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/hive/CarbonInternalMetastore.scala: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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×6
  • Duplicated block (8 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:105 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:105-112 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:199-206 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:595-602 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:105` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:64 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:64-71 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:63-70 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:63-70 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 253 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, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:71` calls `ifDefaultValueMatchesFilter` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:72` 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 × 3) core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:75 — core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:75-82 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:186-193 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:240-247 — 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 `core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:75` 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) core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:205 — core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:205-212 | core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:375-382 | core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:443-450 — 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 `core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:205` 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) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:896 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:896-903 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/JsonCarbonWriter.java:173-180 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:251-258 — 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) integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:48 — integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:48-55 | integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala:52-59 | integration/spark/src/main/spark3.1/org/apache/spark/sql/CarbonToSparkAdapter.scala:52-59 — before extracting anything, compare `integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala` and `integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×5
  • Duplicated block (16 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:142 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:142-157 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:130-145 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:142` 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) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:357 — core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:357-372 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:1118-1133 — 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 `core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:357` 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/carbondata/processing/sort/sortdata/SortParameters.java:524 — processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:524-539 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:697-712 — 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) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:281 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:281-296 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:730-745 — 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 (16 lines × 2) python/pycarbon/reader.py:102 — python/pycarbon/reader.py:102-117 | python/pycarbon/reader.py:146-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 `python/pycarbon/reader.py: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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×5
  • Duplicated block (7–8 lines × 2) core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:387 — core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:387-393 | core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:414-421 — 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 `core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:387` 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–8 lines × 2) core/src/main/java/org/apache/carbondata/core/locks/CarbonLockUtil.java:52 — core/src/main/java/org/apache/carbondata/core/locks/CarbonLockUtil.java:52-58 | core/src/main/java/org/apache/carbondata/core/locks/CarbonLockUtil.java:64-71 — 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 `core/src/main/java/org/apache/carbondata/core/locks/CarbonLockUtil.java:52` 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–8 lines × 2) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:975 — processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:975-982 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:1025-1031 — 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/carbondata/processing/util/CarbonLoaderUtil.java:975` 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 (7–8 lines × 2) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonIUD.java:102 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonIUD.java:102-109 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonIUD.java:186-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 `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonIUD.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 (7–8 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala:537 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala:537-544 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala:600-606 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala:537` 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 · Duplicated block (7 lines × 3) · ×5
  • Duplicated block (7 lines × 3) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:193 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:193-199 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:210-216 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:225-231 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:193` 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 `long` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:201` calls `putLong` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:217` 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 (7 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:326 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:326-332 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:420-426 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:396-402 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:326` 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 × 3) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:98 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:98-104 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CSVCarbonWriter.java:66-72 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/JsonCarbonWriter.java:73-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.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 (7 lines × 3) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:486 — integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:486-492 | integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:509-515 | integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:553-559 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:486` 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 × 3) integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:57 — integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:57-63 | integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala:61-67 | integration/spark/src/main/spark3.1/org/apache/spark/sql/CarbonToSparkAdapter.scala:61-67 — before extracting anything, compare `integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala` and `integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×5
  • Duplicated block (5 lines × 3) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:400 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:400-404 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:474-478 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:501-505 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.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.
  • Duplicated block (5 lines × 3) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:490 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:490-494 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:428-432 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:458-462 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:490` 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 × 3) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:420 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:420-424 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:402-406 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:450-454 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 125 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:420` 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 × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:101 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:101-105 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:102-106 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:100-104 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.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 (5 lines × 3) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/ShowIndexesCommand.scala:56 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/ShowIndexesCommand.scala:56-60 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/stream/CarbonShowStreamsCommand.scala:41-45 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/view/CarbonShowMVCommand.scala:44-48 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/ShowIndexesCommand.scala:56` 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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×4
  • Duplicated block (24 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/datatype/Field.java:54 — core/src/main/java/org/apache/carbondata/core/metadata/datatype/Field.java:54-77 | core/src/main/java/org/apache/carbondata/core/metadata/datatype/Field.java:110-133 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/datatype/Field.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 (24 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:180 — integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:180-203 | integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala:229-252 — 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 `integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessorStepOnSpark.scala: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 (24 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:501 — integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:501-524 | integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:545-568 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:501` 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 (24 lines × 2) python/pycarbon/core/carbon_tf_utils.py:61 — python/pycarbon/core/carbon_tf_utils.py:61-84 | python/pycarbon/integration/tensorflow.py:65-88 — before extracting anything, compare `python/pycarbon/core/carbon_tf_utils.py` and `python/pycarbon/integration/tensorflow.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×4
  • Duplicated block (21 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:154 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:154-174 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:131-151 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.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.
  • Duplicated block (21 lines × 2) python/pycarbon/core/carbon_tf_utils.py:163 — python/pycarbon/core/carbon_tf_utils.py:163-183 | python/pycarbon/integration/tensorflow.py:162-182 — before extracting anything, compare `python/pycarbon/core/carbon_tf_utils.py` and `python/pycarbon/integration/tensorflow.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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 `python/pycarbon/core/carbon_tf_utils.py:163` 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 (21 lines × 2) examples/spark/src/main/scala/org/apache/carbondata/examples/CarbonSessionExample.scala:32 — examples/spark/src/main/scala/org/apache/carbondata/examples/CarbonSessionExample.scala:32-52 | examples/spark/src/main/scala/org/apache/carbondata/examples/GeoTableExampleWithCarbonSession.scala:32-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. 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 (21 lines × 2) examples/spark/src/main/scala/org/apache/carbondata/examples/S3Example.scala:42 — examples/spark/src/main/scala/org/apache/carbondata/examples/S3Example.scala:42-62 | examples/spark/src/main/scala/org/apache/carbondata/examples/S3UsingSDkExample.scala:82-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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×4
  • Duplicated block (19 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:413 — core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:413-431 | core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:455-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 `core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:413` 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 (19 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:491 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:491-509 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:496-514 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 401 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 (19 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/model/CarbonLoadModel.java:404 — processing/src/main/java/org/apache/carbondata/processing/loading/model/CarbonLoadModel.java:404-422 | processing/src/main/java/org/apache/carbondata/processing/loading/model/CarbonLoadModel.java:459-477 — 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 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 (19 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepImpl.java:167 — processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepImpl.java:167-185 | processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:302-320 — 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:134 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:134-150 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:111-127 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:134` 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) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:311 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:311-327 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:357-373 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 125 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:311` 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) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:530 — core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:530-546 | core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:635-651 — 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 `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:530` 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, `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:634` calls `add` and `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:529` 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 (17 lines × 2) mv/plan/src/main/spark2.4/org/apache/carbondata/mv/plans/modular/ExpressionHelper.scala:32 — mv/plan/src/main/spark2.4/org/apache/carbondata/mv/plans/modular/ExpressionHelper.scala:32-48 | mv/plan/src/main/spark3.1/org/apache/carbondata/mv/plans/modular/ExpressionHelper.scala:40-56 — before extracting anything, compare `mv/plan/src/main/spark2.4/org/apache/carbondata/mv/plans/modular/ExpressionHelper.scala` and `mv/plan/src/main/spark3.1/org/apache/carbondata/mv/plans/modular/ExpressionHelper.scala` 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 `mv/plan/src/main/spark2.4/org/apache/carbondata/mv/plans/modular/ExpressionHelper.scala:32` 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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×4
  • Duplicated block (9 lines × 5) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:131 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:131-139 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:143-151 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:119-127 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:120-128 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:121-129 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:131` 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 × 5) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:224 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:224-232 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:377-385 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:188-196 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:355-363 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:351-359 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:224` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:156 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:156-164 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:356-364 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:167-175 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:334-342 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:330-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 all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.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 (9 lines × 5) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:463 — hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:463-471 | hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:475-483 | hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:487-495 | hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:499-507 | hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:510-520 — 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 `hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:463` 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:125 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:125-151 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.java:121-147 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterImpl.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. Read the line range as the matched WINDOW rather than a finished unit: at `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterImpl.java:125` 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 × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:199 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:199-225 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java:213-239 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 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 (27 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/DeleteExecution.scala:367 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/DeleteExecution.scala:367-393 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/DeleteExecution.scala:438-464 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/DeleteExecution.scala:367` 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 · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:279 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:279-301 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:276-298 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 401 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:279` 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 (23 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/MeasureColumnVisitor.java:52 — core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/MeasureColumnVisitor.java:52-74 | core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/NoDictionaryTypeVisitor.java:51-73 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/MeasureColumnVisitor.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/NoDictionaryTypeVisitor.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. 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 (23 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:206 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:206-228 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala:93-115 — before extracting anything, compare `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala` and `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala: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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×3
  • Duplicated block (8–9 lines × 2) core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java:305 — core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java:305-313 | core/src/main/java/org/apache/carbondata/core/util/CarbonMetadataUtil.java:137-144 — 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–9 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:1023 — integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:1023-1030 | integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:1031-1039 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:1023` 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) examples/spark/src/main/scala/org/apache/carbondata/examples/CDCExample.scala:207 — examples/spark/src/main/scala/org/apache/carbondata/examples/CDCExample.scala:207-215 | examples/spark/src/main/scala/org/apache/carbondata/examples/DedupExample.scala:144-151 — 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 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, `examples/spark/src/main/scala/org/apache/carbondata/examples/DedupExample.scala:151` calls `getOrCreateCarbonSession`, `setLogLevel` and `examples/spark/src/main/scala/org/apache/carbondata/examples/CDCExample.scala:215` 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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×3
  • Duplicated block (8 lines × 5) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:126 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:126-133 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:431-438 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:141-148 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:221-228 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:603-610 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.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.
  • Duplicated block (8 lines × 5) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:144 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:144-151 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:285-292 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:342-349 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:276-283 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:273-280 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:152` calls `getMeasureDataType` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:293` 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 × 5) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:595 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:595-602 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:589-596 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:596-603 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:607-614 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:615-622 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:595` 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×3
  • Duplicated block (6 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:130 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:130-135 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:140-145 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRestructureBasedRawResultCollector.java:112-117 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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, `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:146` calls `getCurrentRowId` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:136` 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 (6 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:84 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:84-89 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:83-88 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:83-88 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 256 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.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 (6 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:157 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:157-162 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ImplicitIncludeFilterExecutorImpl.java:57-62 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/TrueFilterExecutor.java:46-51 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×3
  • Duplicated block (5 lines × 5) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:183 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:183-187 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:206-210 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:229-233 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:252-256 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:277-281 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:183` 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 × 5) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:327 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:327-331 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:317-321 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:314-318 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:291-295 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:301-305 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:327` 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 (5 lines × 5) integration/hive/src/main/java/org/apache/carbondata/hive/Hive2CarbonExpression.java:118 — integration/hive/src/main/java/org/apache/carbondata/hive/Hive2CarbonExpression.java:118-122 | integration/hive/src/main/java/org/apache/carbondata/hive/Hive2CarbonExpression.java:125-129 | integration/hive/src/main/java/org/apache/carbondata/hive/Hive2CarbonExpression.java:132-136 | integration/hive/src/main/java/org/apache/carbondata/hive/Hive2CarbonExpression.java:139-143 | integration/hive/src/main/java/org/apache/carbondata/hive/Hive2CarbonExpression.java:146-150 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×3
  • Duplicated block (5 lines × 4) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:97 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:97-101 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:109-113 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:144-148 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:158-162 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.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.
  • Duplicated block (5 lines × 4) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:177 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:177-181 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:192-196 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:209-213 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:224-228 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:177` 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 `int` 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 (5 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:84 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:84-88 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:84-88 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:83-87 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:83-87 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.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.
D6 · Cohesion (LCOM4) · Low cohesion · ×3
  • Low cohesion: CarbonTableConfig (LCOM4 13) integration/presto/src/main/java/org/apache/carbondata/presto/impl/CarbonTableConfig.java:25 — CarbonTableConfig's methods fall into 13 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 13 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: CarbonAntlrSqlVisitor (LCOM4 6) integration/spark/src/main/java/org/apache/spark/sql/CarbonAntlrSqlVisitor.java:41 — CarbonAntlrSqlVisitor'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: AvroCarbonWriter (LCOM4 4) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:81 — AvroCarbonWriter'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.
D1 · Cyclomatic Complexity · SparkVersionAdapter.createCarbonTable (cyclomatic 27) · ×2
  • SparkVersionAdapter.createCarbonTable (cyclomatic 27) integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:230 — SparkVersionAdapter.createCarbonTable 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.
  • SparkVersionAdapter.createCarbonTable (cyclomatic 27) integration/spark/src/main/spark3.1/org/apache/spark/sql/SparkVersionAdapter.scala:257 — SparkVersionAdapter.createCarbonTable 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.
D1 · Cyclomatic Complexity · 1.decodeAndFillVector (cyclomatic 26) · ×2
  • 1.decodeAndFillVector (cyclomatic 26) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:253 — 1.decodeAndFillVector has cyclomatic complexity 26 (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.
  • 1.decodeAndFillVector (cyclomatic 26) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:243 — 1.decodeAndFillVector has cyclomatic complexity 26 (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.
D2 · Cognitive Complexity · SparkVersionAdapter.createCarbonTable (cognitive 49) · ×2
  • SparkVersionAdapter.createCarbonTable (cognitive 49) integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:230 — SparkVersionAdapter.createCarbonTable has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 6, loops 1 (3 pts), error handling 1 (2 pts), match/switch 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.
  • SparkVersionAdapter.createCarbonTable (cognitive 49) integration/spark/src/main/spark3.1/org/apache/spark/sql/SparkVersionAdapter.scala:257 — SparkVersionAdapter.createCarbonTable has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 6, loops 1 (3 pts), error handling 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · 1.decodeAndFillVector (cognitive 42) · ×2
  • 1.decodeAndFillVector (cognitive 42) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:253 — 1.decodeAndFillVector has cognitive complexity 42 (threshold 15). Drivers by points: loops 10 (24 pts), if/else 13 (14 pts), boolean chains 4 (nesting depth added 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.
  • 1.decodeAndFillVector (cognitive 42) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:243 — 1.decodeAndFillVector has cognitive complexity 42 (threshold 15). Drivers by points: loops 10 (24 pts), if/else 13 (14 pts), boolean chains 4 (nesting depth added 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.
D2 · Cognitive Complexity · CarbonIndexFileMergeWriter.mergeCarbonIndexFilesOfSegment (cognitive 18) · ×2
  • CarbonIndexFileMergeWriter.mergeCarbonIndexFilesOfSegment (cognitive 18) core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileMergeWriter.java:129 — CarbonIndexFileMergeWriter.mergeCarbonIndexFilesOfSegment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2, 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.
  • CarbonIndexFileMergeWriter.mergeCarbonIndexFilesOfSegment (cognitive 18) core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileMergeWriter.java:82 — CarbonIndexFileMergeWriter.mergeCarbonIndexFilesOfSegment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 1 (3 pts), boolean chains 2, 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×2
  • Duplicated block (36 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java:96 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java:96-131 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMerger.java:92-127 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeIntermediateFileMerger.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateFileMerger.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 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 (36 lines × 2) REDACTED:92 — REDACTED:92-127 | REDACTED:89-124 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 114 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 `REDACTED: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.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×2
  • Duplicated block (33 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:322 — core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:322-354 | core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:375-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 `core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:322` 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 (33 lines × 2) core/src/main/java/org/apache/carbondata/core/util/NonDictionaryUtil.java:1 — core/src/main/java/org/apache/carbondata/core/util/NonDictionaryUtil.java:1-33 | processing/src/main/java/org/apache/carbondata/processing/sort/DummyRowUpdater.java:1-41 — 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 `core/src/main/java/org/apache/carbondata/core/util/NonDictionaryUtil.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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:129 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:129-153 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRestructureBasedRawResultCollector.java:101-125 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRestructureBasedRawResultCollector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 95 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 `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:129` 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) integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:49 — integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:49-73 | integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:50-74 — before extracting anything, compare `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala` and `integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala` as WHOLE FILES: this scan already matched 3 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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:428 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:428-449 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:423-444 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 401 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:428` 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 (22 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/view/MVHelper.scala:255 — integration/spark/src/main/scala/org/apache/carbondata/view/MVHelper.scala:255-276 | integration/spark/src/main/scala/org/apache/carbondata/view/MVHelper.scala:283-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 `integration/spark/src/main/scala/org/apache/carbondata/view/MVHelper.scala: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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×2
  • Duplicated block (20–21 lines × 2) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:109 — core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:109-129 | core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:148-167 — 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 `core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:109` 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, `core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:169` calls `parseTimestamp` and `core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:130` 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–21 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:116 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:116-136 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java:117-136 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/UnsafeParallelReadMergeSorterWithColumnRangeImpl.java` as WHOLE FILES: this scan already matched 5 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 `processing/src/main/java/org/apache/carbondata/processing/loading/sort/impl/ParallelReadMergeSorterWithColumnRangeImpl.java:116` 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 · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:70 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:70-89 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java:74-93 — before extracting anything, compare `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java` and `integration/flink/src/main/java/org/apache/carbon/flink/CarbonS3Writer.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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 `integration/flink/src/main/java/org/apache/carbon/flink/CarbonLocalWriter.java:70` 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) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonPlanHelper.scala:203 — integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonPlanHelper.scala:203-222 | integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonPlanHelper.scala:229-248 — 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonPlanHelper.scala:203` 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.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×2
  • Duplicated block (17–19 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:474 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:474-492 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:576-592 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:474` 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) integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala:116 — integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala:116-132 | integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala:157-175 — 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 `integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala:116` 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×2
  • Duplicated block (16–17 lines × 2) core/src/main/java/org/apache/carbondata/core/metadata/CarbonTableIdentifier.java:125 — core/src/main/java/org/apache/carbondata/core/metadata/CarbonTableIdentifier.java:125-140 | core/src/main/java/org/apache/carbondata/core/metadata/schema/table/TableSchema.java:175-191 — 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 `core/src/main/java/org/apache/carbondata/core/metadata/CarbonTableIdentifier.java:125` 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–17 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:550 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:550-566 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:558-573 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:550` 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.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×2
  • Duplicated block (14–16 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedVectorResultCollector.java:169 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedVectorResultCollector.java:169-184 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedVectorResultCollector.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 `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedVectorResultCollector.java:169` 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) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:325 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:325-340 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:382-395 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/EqualToExpression.java:57 — core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/EqualToExpression.java:57-71 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotEqualsExpression.java:54-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 `core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/EqualToExpression.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 (14–15 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:575 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:575-589 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:636-649 — 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/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:575` 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/NoDictionaryTypeVisitor.java:66 — core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/NoDictionaryTypeVisitor.java:66-78 | core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/RangeNoDictionaryTypeVisitor.java:69-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 `core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/NoDictionaryTypeVisitor.java:66` 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–14 lines × 2) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:650 — integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:650-663 | integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:302-314 — 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×2
  • Duplicated block (12–14 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:247 — core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:247-260 | core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:290-301 — 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–14 lines × 2) core/src/main/java/org/apache/carbondata/core/view/MVManager.java:365 — core/src/main/java/org/apache/carbondata/core/view/MVManager.java:365-378 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:365-376 — 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 `core/src/main/java/org/apache/carbondata/core/view/MVManager.java:365` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:374 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:374-385 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:448-460 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.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, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:372` calls `flip` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:447` 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 (12–13 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:309 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:309-321 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:366-377 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:309` 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 5) · ×2
  • Duplicated block (10–11 lines × 5) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanEqualToExpression.java:41 — core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanEqualToExpression.java:41-50 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanExpression.java:42-52 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/LessThanEqualToExpression.java:41-50 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/LessThanExpression.java:46-55 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/StartsWithExpression.java:42-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 all 5 call sites, so a change lands once.
  • Duplicated block (10–11 lines × 5) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:387 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:387-397 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:228-237 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:285-294 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:227-236 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:224-233 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:387` 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:117 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:117-127 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:123-133 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRestructureBasedRawResultCollector.java:95-105 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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 `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.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 (11 lines × 3) integration/spark/src/main/spark2.3/org/apache/spark/sql/hive/CarbonSessionStateBuilder.scala:88 — integration/spark/src/main/spark2.3/org/apache/spark/sql/hive/CarbonSessionStateBuilder.scala:88-98 | integration/spark/src/main/spark2.4/org/apache/spark/sql/hive/CarbonSessionStateBuilder.scala:88-98 | integration/spark/src/main/spark3.1/org/apache/spark/sql/hive/CarbonSessionStateBuilder.scala:88-98 — before extracting anything, compare `integration/spark/src/main/spark2.3/org/apache/spark/sql/hive/CarbonSessionStateBuilder.scala` and `integration/spark/src/main/spark2.4/org/apache/spark/sql/hive/CarbonSessionStateBuilder.scala` 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. 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×2
  • Duplicated block (9–11 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:206 — core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:206-216 | core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:218-226 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.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. 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–11 lines × 2) index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomCoarseGrainIndexFactory.java:261 — index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomCoarseGrainIndexFactory.java:261-269 | index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomCoarseGrainIndexFactory.java:308-318 — 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 `index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomCoarseGrainIndexFactory.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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeTypeExecutorFactory.java:46 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeTypeExecutorFactory.java:46-55 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeTypeExecutorFactory.java:58-67 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeTypeExecutorFactory.java:70-79 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeTypeExecutorFactory.java:82-91 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeTypeExecutorFactory.java:46` 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 × 4) REDACTED:185 — REDACTED:185-194 | REDACTED:183-192 | REDACTED:189-198 | REDACTED:178-187 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 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 `REDACTED: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.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×2
  • Duplicated block (9–10 lines × 3) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:317 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:317-325 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:291-300 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:301-309 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:317` 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–10 lines × 3) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:478 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:478-486 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:502-510 | core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java:178-187 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:478` 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 · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:194 — core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:194-202 | core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:364-372 | core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFullScanner.java:70-78 — 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 `core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:191` calls `setBlockletId`, `getBlockIdString`, `valueOf` and `core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:361` 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) integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:149 — integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:149-157 | integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala:178-186 | integration/spark/src/main/spark3.1/org/apache/spark/sql/CarbonToSparkAdapter.scala:153-161 — before extracting anything, compare `integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala` and `integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 `integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:149` 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, `integration/spark/src/main/spark2.4/org/apache/spark/sql/CarbonToSparkAdapter.scala:188` calls `getTheLastQualifier` and `integration/spark/src/main/spark2.3/org/apache/spark/sql/CarbonToSparkAdapter.scala:166` 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:105 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:105-111 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:108-114 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:202-208 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:156-162 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:386-393 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:209` calls `getFilterKeys` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:163` 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 (7 lines × 5) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:103 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:103-109 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:424-430 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:153-159 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:383-390 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:728-734 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:422` calls `readColumnChunks` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:151` 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:561 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:561-566 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:568-573 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:578-583 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:587-592 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:561` 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) examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3Example.java:101 — examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3Example.java:101-106 | examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3Example.java:116-121 | examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3ReadExample.java:84-89 | examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3ReadExample.java:103-108 — 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 `examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3Example.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3Example.java:123` calls `getInstance`, `addProperty` and `examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3ReadExample.java:109` 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.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×2
  • Duplicated block (39 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/exception/CarbonDataLoadingException.java:36 — processing/src/main/java/org/apache/carbondata/processing/loading/exception/CarbonDataLoadingException.java:36-74 | processing/src/main/java/org/apache/carbondata/processing/sort/exception/CarbonSortKeyAndGroupByException.java:39-88 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/exception/CarbonDataLoadingException.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/exception/CarbonSortKeyAndGroupByException.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 200 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 (39 lines × 2) integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonExtensionSqlParser.scala:43 — integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonExtensionSqlParser.scala:43-81 | integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonExtensionSqlParser.scala:43-81 — before extracting anything, compare `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonExtensionSqlParser.scala` and `integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonExtensionSqlParser.scala` as WHOLE FILES: 98% 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) integration/spark/src/main/scala/org/apache/carbondata/streaming/StreamSinkFactory.scala:198 — integration/spark/src/main/scala/org/apache/carbondata/streaming/StreamSinkFactory.scala:198-210 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:280-292 | integration/spark/src/main/scala/org/apache/spark/sql/execution/datasources/SparkCarbonTableFormat.scala:121-133 — 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 (13 lines × 3) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:241 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:241-253 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala:121-133 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:136-148 — before extracting anything, compare `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala` and `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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, `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:149` calls `info` and `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:254` 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.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: carbondata-flink-proxy — carbondata-flink-proxy: abstractness 0.20, instability 0.00, distance 0.80 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: carbondata-mv-plan_${spark.binary.version} — carbondata-mv-plan_${spark.binary.version}: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
D1 · Cyclomatic Complexity · 1.fillPrimitiveType (cyclomatic 71) · ×1
  • 1.fillPrimitiveType (cyclomatic 71) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:328 — 1.fillPrimitiveType 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.
D1 · Cyclomatic Complexity · MVMatchPattern.doMatch (cyclomatic 69) · ×1
  • MVMatchPattern.doMatch (cyclomatic 69) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:305 — MVMatchPattern.doMatch 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.
D1 · Cyclomatic Complexity · 1.fillVector (cyclomatic 68) · ×1
  • 1.fillVector (cyclomatic 68) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:327 — 1.fillVector has cyclomatic complexity 68 (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.
D1 · Cyclomatic Complexity · CarbonCreateSecondaryIndexCommand.processData (cyclomatic 58) · ×1
  • CarbonCreateSecondaryIndexCommand.processData (cyclomatic 58) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/command/SICreationCommand.scala:83 — CarbonCreateSecondaryIndexCommand.processData has cyclomatic complexity 58 (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.
D1 · Cyclomatic Complexity · 1.fillVector (cyclomatic 57) · ×1
  • 1.fillVector (cyclomatic 57) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:302 — 1.fillVector has cyclomatic complexity 57 (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.
D1 · Cyclomatic Complexity · SessionParams.validateKeyValue (cyclomatic 54) · ×1
  • SessionParams.validateKeyValue (cyclomatic 54) core/src/main/java/org/apache/carbondata/core/util/SessionParams.java:128 — SessionParams.validateKeyValue has cyclomatic complexity 54 (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.
D1 · Cyclomatic Complexity · StreamRecordReader.readRowFromStream (cyclomatic 53) · ×1
  • StreamRecordReader.readRowFromStream (cyclomatic 53) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:355 — StreamRecordReader.readRowFromStream has cyclomatic complexity 53 (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.
D1 · Cyclomatic Complexity · CarbonMergerRDD.internalGetPartitions (cyclomatic 53) · ×1
  • CarbonMergerRDD.internalGetPartitions (cyclomatic 53) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:281 — CarbonMergerRDD.internalGetPartitions has cyclomatic complexity 53 (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.
D1 · Cyclomatic Complexity · CarbonMergeDataSetCommand.processData (cyclomatic 53) · ×1
  • CarbonMergeDataSetCommand.processData (cyclomatic 53) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetCommand.scala:85 — CarbonMergeDataSetCommand.processData has cyclomatic complexity 53 (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.
D1 · Cyclomatic Complexity · SelectSelectNoChildDelta.apply (cyclomatic 52) · ×1
  • SelectSelectNoChildDelta.apply (cyclomatic 52) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:660 — SelectSelectNoChildDelta.apply has cyclomatic complexity 52 (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.
D1 · Cyclomatic Complexity · CarbonDataRDDFactory.loadCarbonData (cyclomatic 50) · ×1
  • CarbonDataRDDFactory.loadCarbonData (cyclomatic 50) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala:283 — CarbonDataRDDFactory.loadCarbonData has cyclomatic complexity 50 (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.
D1 · Cyclomatic Complexity · DDLStrategy.apply (cyclomatic 48) · ×1
  • DDLStrategy.apply (cyclomatic 48) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/DDLStrategy.scala:57 — DDLStrategy.apply has cyclomatic complexity 48 (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.
D1 · Cyclomatic Complexity · SecondaryIndexCreator.createSecondaryIndex (cyclomatic 46) · ×1
  • SecondaryIndexCreator.createSecondaryIndex (cyclomatic 46) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/rdd/SecondaryIndexCreator.scala:66 — SecondaryIndexCreator.createSecondaryIndex has cyclomatic complexity 46 (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.
D1 · Cyclomatic Complexity · CarbonAlterTableColRenameDataTypeChangeCommand.processMetadata (cyclomatic 43) · ×1
  • CarbonAlterTableColRenameDataTypeChangeCommand.processMetadata (cyclomatic 43) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableColRenameDataTypeChangeCommand.scala:88 — CarbonAlterTableColRenameDataTypeChangeCommand.processMetadata has cyclomatic complexity 43 (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.
D1 · Cyclomatic Complexity · ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.convert (cyclomatic 42) · ×1
  • ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.convert (cyclomatic 42) core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:87 — ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.convert has cyclomatic complexity 42 (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.
D1 · Cyclomatic Complexity · AlterTableColumnSchemaGenerator.process (cyclomatic 39) · ×1
  • AlterTableColumnSchemaGenerator.process (cyclomatic 39) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala:293 — AlterTableColumnSchemaGenerator.process has cyclomatic complexity 39 (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.
D1 · Cyclomatic Complexity · CarbonSecondaryIndexOptimizer.transformFilterToJoin (cyclomatic 38) · ×1
  • CarbonSecondaryIndexOptimizer.transformFilterToJoin (cyclomatic 38) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:736 — CarbonSecondaryIndexOptimizer.transformFilterToJoin 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.
D1 · Cyclomatic Complexity · FilterExecutorUtil.executeIncludeExcludeFilterForMeasure (cyclomatic 36) · ×1
  • FilterExecutorUtil.executeIncludeExcludeFilterForMeasure (cyclomatic 36) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExecutorUtil.java:57 — FilterExecutorUtil.executeIncludeExcludeFilterForMeasure 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.
D1 · Cyclomatic Complexity · RowLevelFilterExecutorImpl.applyFilter (cyclomatic 34) · ×1
  • RowLevelFilterExecutorImpl.applyFilter (cyclomatic 34) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:196 — RowLevelFilterExecutorImpl.applyFilter 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.
D1 · Cyclomatic Complexity · CommonLoadUtils.loadDataWithPartition (cyclomatic 34) · ×1
  • CommonLoadUtils.loadDataWithPartition (cyclomatic 34) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:869 — CommonLoadUtils.loadDataWithPartition 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.
D1 · Cyclomatic Complexity · CarbonProjectForUpdateCommand.processData (cyclomatic 34) · ×1
  • CarbonProjectForUpdateCommand.processData (cyclomatic 34) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForUpdateCommand.scala:59 — CarbonProjectForUpdateCommand.processData 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.
D1 · Cyclomatic Complexity · CarbonLoaderUtil.recordNewLoadMetadata (cyclomatic 31) · ×1
  • CarbonLoaderUtil.recordNewLoadMetadata (cyclomatic 31) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:234 — CarbonLoaderUtil.recordNewLoadMetadata 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.
D1 · Cyclomatic Complexity · CarbonUtil.setLocalDictColumnsToWrapperSchema (cyclomatic 30) · ×1
  • CarbonUtil.setLocalDictColumnsToWrapperSchema (cyclomatic 30) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2927 — CarbonUtil.setLocalDictColumnsToWrapperSchema 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.
D1 · Cyclomatic Complexity · CarbonCreateMVCommand.doCreate (cyclomatic 30) · ×1
  • CarbonCreateMVCommand.doCreate (cyclomatic 30) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/view/CarbonCreateMVCommand.scala:156 — CarbonCreateMVCommand.doCreate has cyclomatic complexity 30 (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.
D1 · Cyclomatic Complexity · DMLStrategy.apply (cyclomatic 29) · ×1
  • DMLStrategy.apply (cyclomatic 29) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/DMLStrategy.scala:54 — DMLStrategy.apply has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · MVRewrite.updatePlan (cyclomatic 29) · ×1
  • MVRewrite.updatePlan (cyclomatic 29) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:734 — MVRewrite.updatePlan has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · PrimitiveDataType.writeByteArray (cyclomatic 28) · ×1
  • PrimitiveDataType.writeByteArray (cyclomatic 28) processing/src/main/java/org/apache/carbondata/processing/datatypes/PrimitiveDataType.java:239 — PrimitiveDataType.writeByteArray 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.
D1 · Cyclomatic Complexity · DataTypeUtil.createTimeInstant (cyclomatic 28) · ×1
  • DataTypeUtil.createTimeInstant (cyclomatic 28) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:450 — DataTypeUtil.createTimeInstant 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.
D1 · Cyclomatic Complexity · CastExpressionOptimization.checkIfCastCanBeRemove (cyclomatic 28) · ×1
  • CastExpressionOptimization.checkIfCastCanBeRemove (cyclomatic 28) integration/spark/src/main/scala/org/apache/spark/sql/execution/CastExpressionOptimization.scala:158 — CastExpressionOptimization.checkIfCastCanBeRemove has cyclomatic complexity 28 (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.
D1 · Cyclomatic Complexity · CarbonSparkSqlParserUtil.buildTableInfoFromCatalogTable (cyclomatic 28) · ×1
  • CarbonSparkSqlParserUtil.buildTableInfoFromCatalogTable (cyclomatic 28) integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala:148 — CarbonSparkSqlParserUtil.buildTableInfoFromCatalogTable 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.
D1 · Cyclomatic Complexity · RowLevelFilterExecutorImpl.createRow (cyclomatic 27) · ×1
  • RowLevelFilterExecutorImpl.createRow (cyclomatic 27) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:443 — RowLevelFilterExecutorImpl.createRow 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.
D1 · Cyclomatic Complexity · DataTypeConverterUtil.convertToCarbonTypeForSpark2 (cyclomatic 27) · ×1
  • DataTypeConverterUtil.convertToCarbonTypeForSpark2 (cyclomatic 27) integration/spark/src/main/scala/org/apache/carbondata/spark/util/DataTypeConverterUtil.scala:58 — DataTypeConverterUtil.convertToCarbonTypeForSpark2 has cyclomatic complexity 27 (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.
D1 · Cyclomatic Complexity · CarbonSparkDataSourceUtil.createCarbonFilter (cyclomatic 27) · ×1
  • CarbonSparkDataSourceUtil.createCarbonFilter (cyclomatic 27) integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/CarbonSparkDataSourceUtil.scala:115 — CarbonSparkDataSourceUtil.createCarbonFilter has cyclomatic complexity 27 (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.
D1 · Cyclomatic Complexity · AvroCarbonWriter.getMappingDataTypeForCollectionRecord (cyclomatic 26) · ×1
  • AvroCarbonWriter.getMappingDataTypeForCollectionRecord (cyclomatic 26) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:749 — AvroCarbonWriter.getMappingDataTypeForCollectionRecord 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.
D1 · Cyclomatic Complexity · AvroCarbonWriter.prepareFields (cyclomatic 26) · ×1
  • AvroCarbonWriter.prepareFields (cyclomatic 26) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:541 — AvroCarbonWriter.prepareFields 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.
D1 · Cyclomatic Complexity · ColumnPageWrapper.getChunkDataInBytes (cyclomatic 26) · ×1
  • ColumnPageWrapper.getChunkDataInBytes (cyclomatic 26) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/ColumnPageWrapper.java:110 — ColumnPageWrapper.getChunkDataInBytes has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · FilterExpressionProcessor.getFilterResolverBasedOnExpressionType (cyclomatic 26) · ×1
  • FilterExpressionProcessor.getFilterResolverBasedOnExpressionType (cyclomatic 26) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:174 — FilterExpressionProcessor.getFilterResolverBasedOnExpressionType 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.
D1 · Cyclomatic Complexity · DataTypeUtil.getDataBasedOnDataType (cyclomatic 26) · ×1
  • DataTypeUtil.getDataBasedOnDataType (cyclomatic 26) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:312 — DataTypeUtil.getDataBasedOnDataType 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.
D1 · Cyclomatic Complexity · CarbonParserUtil.prepareTableModel (cyclomatic 26) · ×1
  • CarbonParserUtil.prepareTableModel (cyclomatic 26) integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:210 — CarbonParserUtil.prepareTableModel 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.
D1 · Cyclomatic Complexity · CarbonParserUtil.validateOptions (cyclomatic 26) · ×1
  • CarbonParserUtil.validateOptions (cyclomatic 26) integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:919 — CarbonParserUtil.validateOptions 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.
D1 · Cyclomatic Complexity · DropIndexCommand.dropIndex (cyclomatic 26) · ×1
  • DropIndexCommand.dropIndex (cyclomatic 26) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/DropIndexCommand.scala:76 — DropIndexCommand.dropIndex 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.
D1 · Cyclomatic Complexity · AggregatePushDown.transformAggregate (cyclomatic 26) · ×1
  • AggregatePushDown.transformAggregate (cyclomatic 26) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/modular/AggregatePushDown.scala:83 — AggregatePushDown.transformAggregate 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.
D1 · Cyclomatic Complexity · DataLoadProcessBuilder.getReArrangedDataFields (cyclomatic 25) · ×1
  • DataLoadProcessBuilder.getReArrangedDataFields (cyclomatic 25) processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:321 — DataLoadProcessBuilder.getReArrangedDataFields 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.
D1 · Cyclomatic Complexity · DataTypeUtil.getDataBasedOnDataTypeForNoDictionaryColumn (cyclomatic 25) · ×1
  • DataTypeUtil.getDataBasedOnDataTypeForNoDictionaryColumn (cyclomatic 25) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:716 — DataTypeUtil.getDataBasedOnDataTypeForNoDictionaryColumn 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.
D1 · Cyclomatic Complexity · CarbonTableCompactor.triggerCompaction (cyclomatic 25) · ×1
  • CarbonTableCompactor.triggerCompaction (cyclomatic 25) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonTableCompactor.scala:204 — CarbonTableCompactor.triggerCompaction 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.
D1 · Cyclomatic Complexity · CarbonIndexUtil.processSIRepair (cyclomatic 25) · ×1
  • CarbonIndexUtil.processSIRepair (cyclomatic 25) integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala:497 — CarbonIndexUtil.processSIRepair 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.
D1 · Cyclomatic Complexity · CarbonFilters.transformExpression (cyclomatic 25) · ×1
  • CarbonFilters.transformExpression (cyclomatic 25) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonFilters.scala:462 — CarbonFilters.transformExpression has cyclomatic complexity 25 (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 is NOT this file's highest cyclomatic complexity: CarbonFilters.translateExpression (cyclomatic 42) 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.
D1 · Cyclomatic Complexity · AvroCarbonWriter.prepareSubFields (cyclomatic 24) · ×1
  • AvroCarbonWriter.prepareSubFields (cyclomatic 24) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:645 — AvroCarbonWriter.prepareSubFields 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.
D1 · Cyclomatic Complexity · DataTypeUtil.convertHiveTypeToCarbon (cyclomatic 24) · ×1
  • DataTypeUtil.convertHiveTypeToCarbon (cyclomatic 24) integration/hive/src/main/java/org/apache/carbondata/hive/util/DataTypeUtil.java:33 — DataTypeUtil.convertHiveTypeToCarbon has cyclomatic complexity 24 (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.
D1 · Cyclomatic Complexity · CarbonInputFormat.getPrunedBlocklets (cyclomatic 24) · ×1
  • CarbonInputFormat.getPrunedBlocklets (cyclomatic 24) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java:540 — CarbonInputFormat.getPrunedBlocklets 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.
D1 · Cyclomatic Complexity · TableSchemaBuilder.addColumn (cyclomatic 24) · ×1
  • TableSchemaBuilder.addColumn (cyclomatic 24) core/src/main/java/org/apache/carbondata/core/metadata/schema/table/TableSchemaBuilder.java:163 — TableSchemaBuilder.addColumn 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.
D1 · Cyclomatic Complexity · CarbonInsertIntoCommand.processData (cyclomatic 24) · ×1
  • CarbonInsertIntoCommand.processData (cyclomatic 24) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:126 — CarbonInsertIntoCommand.processData 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.
D1 · Cyclomatic Complexity · CarbonDataset.__init__ (cyclomatic 24) · ×1
  • CarbonDataset.__init__ (cyclomatic 24) python/pycarbon/core/carbon.py:32 — CarbonDataset.__init__ 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.
D1 · Cyclomatic Complexity · AvroCarbonWriter.avroFieldToObject (cyclomatic 23) · ×1
  • AvroCarbonWriter.avroFieldToObject (cyclomatic 23) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:184 — AvroCarbonWriter.avroFieldToObject 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.
D1 · Cyclomatic Complexity · TableFieldStat.<init> (cyclomatic 23) · ×1
  • TableFieldStat.<init> (cyclomatic 23) processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/TableFieldStat.java:97 — TableFieldStat.<init> 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.
D1 · Cyclomatic Complexity · ColumnPage.newPage (cyclomatic 23) · ×1
  • ColumnPage.newPage (cyclomatic 23) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:177 — ColumnPage.newPage has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · SegmentStatusManager.getValidAndInvalidSegments (cyclomatic 23) · ×1
  • SegmentStatusManager.getValidAndInvalidSegments (cyclomatic 23) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:137 — SegmentStatusManager.getValidAndInvalidSegments 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.
D1 · Cyclomatic Complexity · DataTypeUtil.getDataBasedOnDataType (cyclomatic 23) · ×1
  • DataTypeUtil.getDataBasedOnDataType (cyclomatic 23) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:814 — DataTypeUtil.getDataBasedOnDataType 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.
D1 · Cyclomatic Complexity · GroupbyGroupbySelectOnlyChildDelta.apply (cyclomatic 23) · ×1
  • GroupbyGroupbySelectOnlyChildDelta.apply (cyclomatic 23) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:1082 — GroupbyGroupbySelectOnlyChildDelta.apply 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.
D1 · Cyclomatic Complexity · CarbonStreamRecordWriter.write (cyclomatic 22) · ×1
  • CarbonStreamRecordWriter.write (cyclomatic 22) streaming/src/main/java/org/apache/carbondata/streaming/CarbonStreamRecordWriter.java:208 — CarbonStreamRecordWriter.write 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.
D1 · Cyclomatic Complexity · CarbonWriterBuilder.buildTableSchema (cyclomatic 22) · ×1
  • CarbonWriterBuilder.buildTableSchema (cyclomatic 22) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:1053 — CarbonWriterBuilder.buildTableSchema 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.
D1 · Cyclomatic Complexity · SortState.mergeHi (cyclomatic 22) · ×1
  • SortState.mergeHi (cyclomatic 22) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:833 — SortState.mergeHi 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. This shape REPEATS in the file: one other method here (SortState.mergeLo) 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.
D1 · Cyclomatic Complexity · SortState.mergeLo (cyclomatic 22) · ×1
  • SortState.mergeLo (cyclomatic 22) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:706 — SortState.mergeLo 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. This shape REPEATS in the file: one other method here (SortState.mergeHi) 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.
D1 · Cyclomatic Complexity · CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSegCount (cyclomatic 22) · ×1
  • CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSegCount (cyclomatic 22) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:610 — CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSegCount 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.
D1 · Cyclomatic Complexity · ColumnPage.decompress (cyclomatic 22) · ×1
  • ColumnPage.decompress (cyclomatic 22) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:788 — ColumnPage.decompress 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.
D1 · Cyclomatic Complexity · FilterUtil.createFilterExecutorTree (cyclomatic 22) · ×1
  • FilterUtil.createFilterExecutorTree (cyclomatic 22) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:119 — FilterUtil.createFilterExecutorTree 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.
D1 · Cyclomatic Complexity · MVRefresher.getSpecificSegmentsTobeLoaded (cyclomatic 22) · ×1
  • MVRefresher.getSpecificSegmentsTobeLoaded (cyclomatic 22) integration/spark/src/main/scala/org/apache/carbondata/view/MVRefresher.scala:258 — MVRefresher.getSpecificSegmentsTobeLoaded 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.
D1 · Cyclomatic Complexity · CarbonAddLoadCommand.processMetadata (cyclomatic 22) · ×1
  • CarbonAddLoadCommand.processMetadata (cyclomatic 22) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAddLoadCommand.scala:74 — CarbonAddLoadCommand.processMetadata 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.
D1 · Cyclomatic Complexity · BroadCastSIFilterPushJoin.addInFilterToPlan (cyclomatic 22) · ×1
  • BroadCastSIFilterPushJoin.addInFilterToPlan (cyclomatic 22) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/joins/BroadCastSIFilterPushJoin.scala:150 — BroadCastSIFilterPushJoin.addInFilterToPlan 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.
D1 · Cyclomatic Complexity · FieldConverter.objectToString (cyclomatic 22) · ×1
  • FieldConverter.objectToString (cyclomatic 22) streaming/src/main/scala/org/apache/carbondata/streaming/parser/FieldConverter.scala:41 — FieldConverter.objectToString 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.
D1 · Cyclomatic Complexity · AvroCarbonWriter.avroFieldToObjectForUnionType (cyclomatic 21) · ×1
  • AvroCarbonWriter.avroFieldToObjectForUnionType (cyclomatic 21) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:405 — AvroCarbonWriter.avroFieldToObjectForUnionType 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.
D1 · Cyclomatic Complexity · CarbonInternalLoaderUtil.recordLoadMetadata (cyclomatic 21) · ×1
  • CarbonInternalLoaderUtil.recordLoadMetadata (cyclomatic 21) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:91 — CarbonInternalLoaderUtil.recordLoadMetadata 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.
D1 · Cyclomatic Complexity · CarbonShowCacheCommand.getAllTablesCache (cyclomatic 21) · ×1
  • CarbonShowCacheCommand.getAllTablesCache (cyclomatic 21) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala:150 — CarbonShowCacheCommand.getAllTablesCache 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.
D1 · Cyclomatic Complexity · CarbonCreateIndexCommand.processMetadata (cyclomatic 21) · ×1
  • CarbonCreateIndexCommand.processMetadata (cyclomatic 21) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/CarbonCreateIndexCommand.scala:62 — CarbonCreateIndexCommand.processMetadata 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.
D1 · Cyclomatic Complexity · DeleteExecution.deleteDeltaExecutionInternal (cyclomatic 21) · ×1
  • DeleteExecution.deleteDeltaExecutionInternal (cyclomatic 21) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/DeleteExecution.scala:94 — DeleteExecution.deleteDeltaExecutionInternal 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.
D1 · Cyclomatic Complexity · CarbonDescribeFormattedCommand.processMetadata (cyclomatic 21) · ×1
  • CarbonDescribeFormattedCommand.processMetadata (cyclomatic 21) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala:52 — CarbonDescribeFormattedCommand.processMetadata 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.
D1 · Cyclomatic Complexity · CarbonInternalMetastore.refreshIndexInfo (cyclomatic 21) · ×1
  • CarbonInternalMetastore.refreshIndexInfo (cyclomatic 21) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/hive/CarbonInternalMetastore.scala:151 — CarbonInternalMetastore.refreshIndexInfo 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.
D1 · Cyclomatic Complexity · DataSummary.run (cyclomatic 20) · ×1
  • DataSummary.run (cyclomatic 20) tools/cli/src/main/java/org/apache/carbondata/tool/DataSummary.java:70 — DataSummary.run 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.
D1 · Cyclomatic Complexity · CarbonLoaderUtil.assignBlocksByDataLocality (cyclomatic 20) · ×1
  • CarbonLoaderUtil.assignBlocksByDataLocality (cyclomatic 20) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:893 — CarbonLoaderUtil.assignBlocksByDataLocality 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.
D1 · Cyclomatic Complexity · VectorizedCarbonRecordReader.initBatch (cyclomatic 20) · ×1
  • VectorizedCarbonRecordReader.initBatch (cyclomatic 20) integration/spark/src/main/java/org/apache/carbondata/spark/vectorreader/VectorizedCarbonRecordReader.java:217 — VectorizedCarbonRecordReader.initBatch 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.
D1 · Cyclomatic Complexity · HiveDataTypeUtils.convertCarbonDataTypeToHive (cyclomatic 20) · ×1
  • HiveDataTypeUtils.convertCarbonDataTypeToHive (cyclomatic 20) integration/hive/src/main/java/org/apache/carbondata/hive/HiveDataTypeUtils.java:37 — HiveDataTypeUtils.convertCarbonDataTypeToHive 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.
D1 · Cyclomatic Complexity · DataTypes.valueOf (cyclomatic 20) · ×1
  • DataTypes.valueOf (cyclomatic 20) core/src/main/java/org/apache/carbondata/core/metadata/datatype/DataTypes.java:75 — DataTypes.valueOf 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.
D1 · Cyclomatic Complexity · RangeExpressionEvaluator.replaceWithRangeExpression (cyclomatic 20) · ×1
  • RangeExpressionEvaluator.replaceWithRangeExpression (cyclomatic 20) core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.java:109 — RangeExpressionEvaluator.replaceWithRangeExpression 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.
D1 · Cyclomatic Complexity · RowLevelRangeGreaterThanFilterExecutorImpl.applyFilter (cyclomatic 20) · ×1
  • RowLevelRangeGreaterThanFilterExecutorImpl.applyFilter (cyclomatic 20) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:274 — RowLevelRangeGreaterThanFilterExecutorImpl.applyFilter 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.
D1 · Cyclomatic Complexity · DataTypeUtil.valueOf (cyclomatic 20) · ×1
  • DataTypeUtil.valueOf (cyclomatic 20) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:1096 — DataTypeUtil.valueOf 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.
D1 · Cyclomatic Complexity · MVRefresher.refresh (cyclomatic 20) · ×1
  • MVRefresher.refresh (cyclomatic 20) integration/spark/src/main/scala/org/apache/carbondata/view/MVRefresher.scala:59 — MVRefresher.refresh 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.
D1 · Cyclomatic Complexity · CarbonParserUtil.extractDimAndMsrFields (cyclomatic 20) · ×1
  • CarbonParserUtil.extractDimAndMsrFields (cyclomatic 20) integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:650 — CarbonParserUtil.extractDimAndMsrFields 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.
D1 · Cyclomatic Complexity · GroupbyGroupbyNoChildDelta.apply (cyclomatic 20) · ×1
  • GroupbyGroupbyNoChildDelta.apply (cyclomatic 20) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:887 — GroupbyGroupbyNoChildDelta.apply 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.
D1 · Cyclomatic Complexity · SelectSelectGroupbyChildDelta.doTopSelectTranslation (cyclomatic 20) · ×1
  • SelectSelectGroupbyChildDelta.doTopSelectTranslation (cyclomatic 20) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:1306 — SelectSelectGroupbyChildDelta.doTopSelectTranslation 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.
D1 · Cyclomatic Complexity · MVRewrite.rewrite (cyclomatic 20) · ×1
  • MVRewrite.rewrite (cyclomatic 20) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:234 — MVRewrite.rewrite 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.
D1 · Cyclomatic Complexity · CarbonFilesystemResolver.__init__ (cyclomatic 20) · ×1
  • CarbonFilesystemResolver.__init__ (cyclomatic 20) python/pycarbon/core/carbon_fs_utils.py:27 — CarbonFilesystemResolver.__init__ 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.
D1 · Cyclomatic Complexity · CarbonLoadModelBuilder.build (cyclomatic 19) · ×1
  • CarbonLoadModelBuilder.build (cyclomatic 19) processing/src/main/java/org/apache/carbondata/processing/loading/model/CarbonLoadModelBuilder.java:147 — CarbonLoadModelBuilder.build 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.
D1 · Cyclomatic Complexity · SecondaryIndexQueryResultProcessor.prepareRowObjectForSorting (cyclomatic 19) · ×1
  • SecondaryIndexQueryResultProcessor.prepareRowObjectForSorting (cyclomatic 19) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/query/SecondaryIndexQueryResultProcessor.java:261 — SecondaryIndexQueryResultProcessor.prepareRowObjectForSorting 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.
D1 · Cyclomatic Complexity · WritableReadSupport.createWritablePrimitive (cyclomatic 19) · ×1
  • WritableReadSupport.createWritablePrimitive (cyclomatic 19) integration/hive/src/main/java/org/apache/carbondata/hive/WritableReadSupport.java:209 — WritableReadSupport.createWritablePrimitive 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.
D1 · Cyclomatic Complexity · SafeFixLengthColumnPage.ensureArraySize (cyclomatic 19) · ×1
  • SafeFixLengthColumnPage.ensureArraySize (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/datastore/page/SafeFixLengthColumnPage.java:426 — SafeFixLengthColumnPage.ensureArraySize 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.
D1 · Cyclomatic Complexity · DecimalIntConverter.fillVector (cyclomatic 19) · ×1
  • DecimalIntConverter.fillVector (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java:113 — DecimalIntConverter.fillVector 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.
D1 · Cyclomatic Complexity · Field.<init> (cyclomatic 19) · ×1
  • Field.<init> (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/metadata/datatype/Field.java:52 — Field.<init> 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.
D1 · Cyclomatic Complexity · CarbonUpdateUtil.cleanUpDeltaFiles (cyclomatic 19) · ×1
  • CarbonUpdateUtil.cleanUpDeltaFiles (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:713 — CarbonUpdateUtil.cleanUpDeltaFiles has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · CarbonUpdateUtil.updateTableMetadataStatus (cyclomatic 19) · ×1
  • CarbonUpdateUtil.updateTableMetadataStatus (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:273 — CarbonUpdateUtil.updateTableMetadataStatus 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.
D1 · Cyclomatic Complexity · RangeValueFilterExecutorImpl.isScanRequired (cyclomatic 19) · ×1
  • RangeValueFilterExecutorImpl.isScanRequired (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:265 — RangeValueFilterExecutorImpl.isScanRequired 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.
D1 · Cyclomatic Complexity · RangeValueFilterExecutorImpl.setFilteredIndexToBitSet (cyclomatic 19) · ×1
  • RangeValueFilterExecutorImpl.setFilteredIndexToBitSet (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:564 — RangeValueFilterExecutorImpl.setFilteredIndexToBitSet 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.
D1 · Cyclomatic Complexity · RowLevelRangeGreaterThanEqualFilterExecutorImpl.applyFilter (cyclomatic 19) · ×1
  • RowLevelRangeGreaterThanEqualFilterExecutorImpl.applyFilter (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:216 — RowLevelRangeGreaterThanEqualFilterExecutorImpl.applyFilter 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.
D1 · Cyclomatic Complexity · CarbonUtil.getDataSizeAndIndexSize (cyclomatic 19) · ×1
  • CarbonUtil.getDataSizeAndIndexSize (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2507 — CarbonUtil.getDataSizeAndIndexSize 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. This is NOT this file's highest cyclomatic complexity: CarbonUtil.delimiterConverter (cyclomatic 20) 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.
D1 · Cyclomatic Complexity · CarbonIndexFileMergeWriter.writeMergeIndexFileBasedOnSegmentFile (cyclomatic 19) · ×1
  • CarbonIndexFileMergeWriter.writeMergeIndexFileBasedOnSegmentFile (cyclomatic 19) core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileMergeWriter.java:227 — CarbonIndexFileMergeWriter.writeMergeIndexFileBasedOnSegmentFile 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.
D1 · Cyclomatic Complexity · CarbonScanRDD.internalGetPartitions (cyclomatic 19) · ×1
  • CarbonScanRDD.internalGetPartitions (cyclomatic 19) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:115 — CarbonScanRDD.internalGetPartitions 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.
D1 · Cyclomatic Complexity · CarbonCreateMVCommand.checkTimeSeriesQuery (cyclomatic 19) · ×1
  • CarbonCreateMVCommand.checkTimeSeriesQuery (cyclomatic 19) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/view/CarbonCreateMVCommand.scala:632 — CarbonCreateMVCommand.checkTimeSeriesQuery 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.
D1 · Cyclomatic Complexity · CarbonPlanHelper.makeDeterministic (cyclomatic 19) · ×1
  • CarbonPlanHelper.makeDeterministic (cyclomatic 19) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonPlanHelper.scala:197 — CarbonPlanHelper.makeDeterministic 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.
D1 · Cyclomatic Complexity · CarbonFilters.translateUDF (cyclomatic 19) · ×1
  • CarbonFilters.translateUDF (cyclomatic 19) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonFilters.scala:224 — CarbonFilters.translateUDF 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. This is NOT this file's highest cyclomatic complexity: CarbonFilters.translateExpression (cyclomatic 42) 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.
D1 · Cyclomatic Complexity · MVMatchPattern.factorOutSubsumer (cyclomatic 19) · ×1
  • MVMatchPattern.factorOutSubsumer (cyclomatic 19) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:78 — MVMatchPattern.factorOutSubsumer has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · MVRewrite.getRolledUpModularPlan (cyclomatic 19) · ×1
  • MVRewrite.getRolledUpModularPlan (cyclomatic 19) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:122 — MVRewrite.getRolledUpModularPlan 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.
D1 · Cyclomatic Complexity · SparkTypeConverter.convertCarbonToSparkDataType (cyclomatic 19) · ×1
  • SparkTypeConverter.convertCarbonToSparkDataType (cyclomatic 19) integration/spark/src/main/scala/org/apache/spark/sql/util/SparkTypeConverter.scala:56 — SparkTypeConverter.convertCarbonToSparkDataType has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · AlterTableUtil.modifyTableProperties (cyclomatic 19) · ×1
  • AlterTableUtil.modifyTableProperties (cyclomatic 19) integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala:422 — AlterTableUtil.modifyTableProperties 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.
D1 · Cyclomatic Complexity · AddSubquery.apply (cyclomatic 19) · ×1
  • AddSubquery.apply (cyclomatic 19) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/SQLBuilder.scala:143 — AddSubquery.apply has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · NonDictionaryFieldConverterImpl.convert (cyclomatic 18) · ×1
  • NonDictionaryFieldConverterImpl.convert (cyclomatic 18) processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/NonDictionaryFieldConverterImpl.java:63 — NonDictionaryFieldConverterImpl.convert 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.
D1 · Cyclomatic Complexity · RowResultMergerProcessor.execute (cyclomatic 18) · ×1
  • RowResultMergerProcessor.execute (cyclomatic 18) processing/src/main/java/org/apache/carbondata/processing/merger/RowResultMergerProcessor.java:109 — RowResultMergerProcessor.execute 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.
D1 · Cyclomatic Complexity · TablePage.<init> (cyclomatic 18) · ×1
  • TablePage.<init> (cyclomatic 18) processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java:91 — TablePage.<init> 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.
D1 · Cyclomatic Complexity · CarbonLoaderUtil.nodeBlockMapping (cyclomatic 18) · ×1
  • CarbonLoaderUtil.nodeBlockMapping (cyclomatic 18) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:546 — CarbonLoaderUtil.nodeBlockMapping 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.
D1 · Cyclomatic Complexity · LuceneIndexWriter.addField (cyclomatic 18) · ×1
  • LuceneIndexWriter.addField (cyclomatic 18) index/lucene/src/main/java/org/apache/carbondata/index/lucene/LuceneIndexWriter.java:244 — LuceneIndexWriter.addField 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.
D1 · Cyclomatic Complexity · ColumnPage.compress (cyclomatic 18) · ×1
  • ColumnPage.compress (cyclomatic 18) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:743 — ColumnPage.compress 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.
D1 · Cyclomatic Complexity · ThriftWrapperSchemaConverterImpl.fromWrapperToExternalDataType (cyclomatic 18) · ×1
  • ThriftWrapperSchemaConverterImpl.fromWrapperToExternalDataType (cyclomatic 18) core/src/main/java/org/apache/carbondata/core/metadata/converter/ThriftWrapperSchemaConverterImpl.java:134 — ThriftWrapperSchemaConverterImpl.fromWrapperToExternalDataType 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.
D1 · Cyclomatic Complexity · Encoding.valueOf (cyclomatic 18) · ×1
  • Encoding.valueOf (cyclomatic 18) core/src/main/java/org/apache/carbondata/core/metadata/encoder/Encoding.java:44 — Encoding.valueOf 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.
D1 · Cyclomatic Complexity · CarbonScanRDD.internalCompute (cyclomatic 18) · ×1
  • CarbonScanRDD.internalCompute (cyclomatic 18) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:461 — CarbonScanRDD.internalCompute 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.
D1 · Cyclomatic Complexity · CarbonMergeFilesRDD.mergeIndexFiles (cyclomatic 18) · ×1
  • CarbonMergeFilesRDD.mergeIndexFiles (cyclomatic 18) integration/spark/src/main/scala/org/apache/spark/rdd/CarbonMergeFilesRDD.scala:70 — CarbonMergeFilesRDD.mergeIndexFiles 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.
D1 · Cyclomatic Complexity · CarbonBuilder.getOrCreateCarbonSession (cyclomatic 18) · ×1
  • CarbonBuilder.getOrCreateCarbonSession (cyclomatic 18) integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala:175 — CarbonBuilder.getOrCreateCarbonSession 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.
D1 · Cyclomatic Complexity · CarbonInsertIntoHadoopFsRelationCommand.run (cyclomatic 18) · ×1
  • CarbonInsertIntoHadoopFsRelationCommand.run (cyclomatic 18) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoHadoopFsRelationCommand.scala:68 — CarbonInsertIntoHadoopFsRelationCommand.run 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.
D1 · Cyclomatic Complexity · CarbonProjectForDeleteCommand.processData (cyclomatic 18) · ×1
  • CarbonProjectForDeleteCommand.processData (cyclomatic 18) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForDeleteCommand.scala:55 — CarbonProjectForDeleteCommand.processData 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.
D1 · Cyclomatic Complexity · CarbonAlterTableDropColumnCommand.processMetadata (cyclomatic 18) · ×1
  • CarbonAlterTableDropColumnCommand.processMetadata (cyclomatic 18) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableDropColumnCommand.scala:43 — CarbonAlterTableDropColumnCommand.processMetadata 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.
D1 · Cyclomatic Complexity · CarbonReader.getFormattedData (cyclomatic 17) · ×1
  • CarbonReader.getFormattedData (cyclomatic 17) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java:135 — CarbonReader.getFormattedData 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.
D1 · Cyclomatic Complexity · CarbonWriterBuilder.withLoadOptions (cyclomatic 17) · ×1
  • CarbonWriterBuilder.withLoadOptions (cyclomatic 17) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:226 — CarbonWriterBuilder.withLoadOptions 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.
D1 · Cyclomatic Complexity · CarbonCompactionUtil.getOverallMinMax (cyclomatic 17) · ×1
  • CarbonCompactionUtil.getOverallMinMax (cyclomatic 17) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonCompactionUtil.java:457 — CarbonCompactionUtil.getOverallMinMax 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.
D1 · Cyclomatic Complexity · CarbonTableInputFormat.getBlockRowCount (cyclomatic 17) · ×1
  • CarbonTableInputFormat.getBlockRowCount (cyclomatic 17) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java:438 — CarbonTableInputFormat.getBlockRowCount 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.
D1 · Cyclomatic Complexity · CarbonTableInputFormat.getFilteredSegment (cyclomatic 17) · ×1
  • CarbonTableInputFormat.getFilteredSegment (cyclomatic 17) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java:224 — CarbonTableInputFormat.getFilteredSegment 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.
D1 · Cyclomatic Complexity · StreamRecordReader.initialize (cyclomatic 17) · ×1
  • StreamRecordReader.initialize (cyclomatic 17) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:126 — StreamRecordReader.initialize 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.
D1 · Cyclomatic Complexity · SegmentFileStore.cleanSegments (cyclomatic 17) · ×1
  • SegmentFileStore.cleanSegments (cyclomatic 17) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:1093 — SegmentFileStore.cleanSegments 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.
D1 · Cyclomatic Complexity · NotInExpression.evaluate (cyclomatic 17) · ×1
  • NotInExpression.evaluate (cyclomatic 17) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotInExpression.java:42 — NotInExpression.evaluate 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.
D1 · Cyclomatic Complexity · RowLevelRangeLessThanEqualFilterExecutorImpl.applyFilter (cyclomatic 17) · ×1
  • RowLevelRangeLessThanEqualFilterExecutorImpl.applyFilter (cyclomatic 17) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:216 — RowLevelRangeLessThanEqualFilterExecutorImpl.applyFilter 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.
D1 · Cyclomatic Complexity · CarbonColumnVectorImpl.getData (cyclomatic 17) · ×1
  • CarbonColumnVectorImpl.getData (cyclomatic 17) core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java:301 — CarbonColumnVectorImpl.getData 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.
D1 · Cyclomatic Complexity · DeleteLoadFolders.physicalFactAndMeasureMetadataDeletion (cyclomatic 17) · ×1
  • DeleteLoadFolders.physicalFactAndMeasureMetadataDeletion (cyclomatic 17) core/src/main/java/org/apache/carbondata/core/util/DeleteLoadFolders.java:106 — DeleteLoadFolders.physicalFactAndMeasureMetadataDeletion 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.
D1 · Cyclomatic Complexity · CarbonStreamerConfig.setConfigsToCarbonProperty (cyclomatic 17) · ×1
  • CarbonStreamerConfig.setConfigsToCarbonProperty (cyclomatic 17) integration/spark/src/main/scala/org/apache/carbondata/streamer/CarbonStreamerConfig.scala:177 — CarbonStreamerConfig.setConfigsToCarbonProperty 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.
D1 · Cyclomatic Complexity · MergeIndexEventListener.onEvent (cyclomatic 17) · ×1
  • MergeIndexEventListener.onEvent (cyclomatic 17) integration/spark/src/main/scala/org/apache/spark/sql/events/MergeIndexEventListener.scala:44 — MergeIndexEventListener.onEvent 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.
D1 · Cyclomatic Complexity · TableNewProcessor.process (cyclomatic 17) · ×1
  • TableNewProcessor.process (cyclomatic 17) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala:706 — TableNewProcessor.process 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.
D1 · Cyclomatic Complexity · CarbonAddLoadCommand.writeMetaForSegment (cyclomatic 17) · ×1
  • CarbonAddLoadCommand.writeMetaForSegment (cyclomatic 17) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAddLoadCommand.scala:227 — CarbonAddLoadCommand.writeMetaForSegment 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.
D1 · Cyclomatic Complexity · CarbonAlterTableCompactionCommand.processData (cyclomatic 17) · ×1
  • CarbonAlterTableCompactionCommand.processData (cyclomatic 17) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala:93 — CarbonAlterTableCompactionCommand.processData 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.
D1 · Cyclomatic Complexity · CarbonAlterTableRenameCommand.processMetadata (cyclomatic 17) · ×1
  • CarbonAlterTableRenameCommand.processMetadata (cyclomatic 17) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala:46 — CarbonAlterTableRenameCommand.processMetadata 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.
D1 · Cyclomatic Complexity · CarbonIUDAnalysisRule.processUpdateQuery (cyclomatic 17) · ×1
  • CarbonIUDAnalysisRule.processUpdateQuery (cyclomatic 17) REDACTED:52 — CarbonIUDAnalysisRule.processUpdateQuery has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · SelectSelectGroupbyChildDelta.apply (cyclomatic 17) · ×1
  • SelectSelectGroupbyChildDelta.apply (cyclomatic 17) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:1445 — SelectSelectGroupbyChildDelta.apply has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · SecondaryIndexUtil.triggerCompaction (cyclomatic 17) · ×1
  • SecondaryIndexUtil.triggerCompaction (cyclomatic 17) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/util/SecondaryIndexUtil.scala:159 — SecondaryIndexUtil.triggerCompaction 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.
D1 · Cyclomatic Complexity · SQLFragmentCompactPrinter.printFragment (cyclomatic 17) · ×1
  • SQLFragmentCompactPrinter.printFragment (cyclomatic 17) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Printers.scala:249 — SQLFragmentCompactPrinter.printFragment 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.
D1 · Cyclomatic Complexity · carbon_reader.make_carbon_reader (cyclomatic 17) · ×1
  • carbon_reader.make_carbon_reader (cyclomatic 17) python/pycarbon/core/carbon_reader.py:47 — carbon_reader.make_carbon_reader 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.
D1 · Cyclomatic Complexity · ArrowWriter.createFieldWriter (cyclomatic 16) · ×1
  • ArrowWriter.createFieldWriter (cyclomatic 16) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/arrow/ArrowWriter.java:100 — ArrowWriter.createFieldWriter 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.
D1 · Cyclomatic Complexity · CarbonReaderBuilder.prepareFileInputFormat (cyclomatic 16) · ×1
  • CarbonReaderBuilder.prepareFileInputFormat (cyclomatic 16) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReaderBuilder.java:292 — CarbonReaderBuilder.prepareFileInputFormat 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.
D1 · Cyclomatic Complexity · MeasureFieldConverterImpl.convert (cyclomatic 16) · ×1
  • MeasureFieldConverterImpl.convert (cyclomatic 16) processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/MeasureFieldConverterImpl.java:65 — MeasureFieldConverterImpl.convert 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.
D1 · Cyclomatic Complexity · InputProcessorIterator.convertToNoDictionaryToBytes (cyclomatic 16) · ×1
  • InputProcessorIterator.convertToNoDictionaryToBytes (cyclomatic 16) processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:367 — InputProcessorIterator.convertToNoDictionaryToBytes 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.
D1 · Cyclomatic Complexity · CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnLoadedDate (cyclomatic 16) · ×1
  • CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnLoadedDate (cyclomatic 16) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:380 — CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnLoadedDate 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.
D1 · Cyclomatic Complexity · CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRowAsDataFieldOrder (cyclomatic 16) · ×1
  • CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRowAsDataFieldOrder (cyclomatic 16) processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:562 — CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRowAsDataFieldOrder 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.
D1 · Cyclomatic Complexity · ColumnVectorProxy.putRowToColumnBatch (cyclomatic 16) · ×1
  • ColumnVectorProxy.putRowToColumnBatch (cyclomatic 16) integration/spark/src/main/java/org/apache/spark/sql/CarbonVectorProxy.java:151 — ColumnVectorProxy.putRowToColumnBatch 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.
D1 · Cyclomatic Complexity · BloomCoarseGrainIndex.createQueryModel (cyclomatic 16) · ×1
  • BloomCoarseGrainIndex.createQueryModel (cyclomatic 16) index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomCoarseGrainIndex.java:203 — BloomCoarseGrainIndex.createQueryModel 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.
D1 · Cyclomatic Complexity · CarbonOutputCommitter.commitJob (cyclomatic 16) · ×1
  • CarbonOutputCommitter.commitJob (cyclomatic 16) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonOutputCommitter.java:106 — CarbonOutputCommitter.commitJob 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.
D1 · Cyclomatic Complexity · StreamRecordReader.readRawRowFromStream (cyclomatic 16) · ×1
  • StreamRecordReader.readRawRowFromStream (cyclomatic 16) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:539 — StreamRecordReader.readRawRowFromStream 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.
D1 · Cyclomatic Complexity · AdaptiveCodec.getPageBasedOnDataType (cyclomatic 16) · ×1
  • AdaptiveCodec.getPageBasedOnDataType (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java:83 — AdaptiveCodec.getPageBasedOnDataType has cyclomatic complexity 16 (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. This shape REPEATS in the file: one other method here (AdaptiveCodec.putDataToPage) 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.
D1 · Cyclomatic Complexity · AdaptiveCodec.putDataToPage (cyclomatic 16) · ×1
  • AdaptiveCodec.putDataToPage (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java:123 — AdaptiveCodec.putDataToPage has cyclomatic complexity 16 (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. This shape REPEATS in the file: one other method here (AdaptiveCodec.getPageBasedOnDataType) 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.
D1 · Cyclomatic Complexity · ColumnPage.getPageLengthInBytes (cyclomatic 16) · ×1
  • ColumnPage.getPageLengthInBytes (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:703 — ColumnPage.getPageLengthInBytes 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.
D1 · Cyclomatic Complexity · EqualToExpression.evaluate (cyclomatic 16) · ×1
  • EqualToExpression.evaluate (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/EqualToExpression.java:44 — EqualToExpression.evaluate 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.
D1 · Cyclomatic Complexity · NotEqualsExpression.evaluate (cyclomatic 16) · ×1
  • NotEqualsExpression.evaluate (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotEqualsExpression.java:43 — NotEqualsExpression.evaluate 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.
D1 · Cyclomatic Complexity · ExpressionResult.equals (cyclomatic 16) · ×1
  • ExpressionResult.equals (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:489 — ExpressionResult.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.
D1 · Cyclomatic Complexity · RangeValueFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex (cyclomatic 16) · ×1
  • RangeValueFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:462 — RangeValueFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex 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.
D1 · Cyclomatic Complexity · RowLevelRangeLessThanFilterExecutorImpl.applyFilter (cyclomatic 16) · ×1
  • RowLevelRangeLessThanFilterExecutorImpl.applyFilter (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:213 — RowLevelRangeLessThanFilterExecutorImpl.applyFilter 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.
D1 · Cyclomatic Complexity · RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSet (cyclomatic 16) · ×1
  • RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSet (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:532 — RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSet 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.
D1 · Cyclomatic Complexity · ConditionalFilterResolverImpl.resolve (cyclomatic 16) · ×1
  • ConditionalFilterResolverImpl.resolve (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/ConditionalFilterResolverImpl.java:67 — ConditionalFilterResolverImpl.resolve 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.
D1 · Cyclomatic Complexity · CarbonUtil.compareMeasureData (cyclomatic 16) · ×1
  • CarbonUtil.compareMeasureData (cyclomatic 16) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1028 — CarbonUtil.compareMeasureData 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. This is NOT this file's highest cyclomatic complexity: CarbonUtil.delimiterConverter (cyclomatic 20) 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.
D1 · Cyclomatic Complexity · CarbonHiveMetastoreListener.onEvent (cyclomatic 16) · ×1
  • CarbonHiveMetastoreListener.onEvent (cyclomatic 16) integration/hive/src/main/scala/org/apache/carbondata/hive/CarbonHiveMetastoreListener.scala:31 — CarbonHiveMetastoreListener.onEvent 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.
D1 · Cyclomatic Complexity · TableStatusRecovery.main (cyclomatic 16) · ×1
  • TableStatusRecovery.main (cyclomatic 16) integration/spark/src/main/scala/org/apache/carbondata/recovery/tablestatus/TableStatusRecovery.scala:40 — TableStatusRecovery.main 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.
D1 · Cyclomatic Complexity · CarbonMergeDataSetUtil.getFilesToScan (cyclomatic 16) · ×1
  • CarbonMergeDataSetUtil.getFilesToScan (cyclomatic 16) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetUtil.scala:243 — CarbonMergeDataSetUtil.getFilesToScan 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.
D1 · Cyclomatic Complexity · CarbonDropTableCommand.processMetadata (cyclomatic 16) · ×1
  • CarbonDropTableCommand.processMetadata (cyclomatic 16) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala:54 — CarbonDropTableCommand.processMetadata 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.
D1 · Cyclomatic Complexity · CarbonSetCommand.validateAndSetValue (cyclomatic 16) · ×1
  • CarbonSetCommand.validateAndSetValue (cyclomatic 16) integration/spark/src/main/scala/org/apache/spark/sql/hive/execution/command/CarbonHiveCommands.scala:111 — CarbonSetCommand.validateAndSetValue 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.
D1 · Cyclomatic Complexity · CarbonSpark2SqlParser.splitQuery (cyclomatic 16) · ×1
  • CarbonSpark2SqlParser.splitQuery (cyclomatic 16) integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala:431 — CarbonSpark2SqlParser.splitQuery 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.
D1 · Cyclomatic Complexity · CarbonSecondaryIndexOptimizer.createIndexFilterDataFrame (cyclomatic 16) · ×1
  • CarbonSecondaryIndexOptimizer.createIndexFilterDataFrame (cyclomatic 16) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:251 — CarbonSecondaryIndexOptimizer.createIndexFilterDataFrame 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.
D1 · Cyclomatic Complexity · LogicalPlanRule.apply (cyclomatic 16) · ×1
  • LogicalPlanRule.apply (cyclomatic 16) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/LogicalPlanSignatureGenerator.scala:56 — LogicalPlanRule.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.
D17 · Explicit Debt · TodoComment repeated across 13 files · ×1
  • TodoComment repeated across 13 files integration/spark/src/test/scala/org/apache/spark/sql/carbondata/datasource/TestCreateTableUsingSparkCarbonFileFormat.scala:129 — The identical TodoComment appears in 13 files (19 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 19 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D2 · Cognitive Complexity · StreamRecordReader.readRowFromStream (cognitive 180) · ×1
  • StreamRecordReader.readRowFromStream (cognitive 180) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:355 — StreamRecordReader.readRowFromStream has cognitive complexity 180 (threshold 15). Drivers by points: if/else 64 (177 pts), loops 3 (nesting depth added 113). 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.
D2 · Cognitive Complexity · 1.fillVector (cognitive 150) · ×1
  • 1.fillVector (cognitive 150) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:327 — 1.fillVector has cognitive complexity 150 (threshold 15). Drivers by points: loops 29 (87 pts), if/else 41 (61 pts), boolean chains 2 (nesting depth added 78). 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.
D2 · Cognitive Complexity · 1.fillPrimitiveType (cognitive 150) · ×1
  • 1.fillPrimitiveType (cognitive 150) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:328 — 1.fillPrimitiveType has cognitive complexity 150 (threshold 15). Drivers by points: if/else 51 (75 pts), loops 24 (70 pts), boolean chains 5 (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.convert (cognitive 141) · ×1
  • ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.convert (cognitive 141) core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:87 — ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.convert has cognitive complexity 141 (threshold 15). Drivers by points: if/else 38 (108 pts), loops 9 (29 pts), boolean chains 4 (nesting depth added 90). 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.
D2 · Cognitive Complexity · MVMatchPattern.doMatch (cognitive 132) · ×1
  • MVMatchPattern.doMatch (cognitive 132) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:305 — MVMatchPattern.doMatch has cognitive complexity 132 (threshold 15). Drivers by points: if/else 48 (90 pts), boolean chains 23, match/switch 9 (19 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SelectSelectNoChildDelta.apply (cognitive 115) · ×1
  • SelectSelectNoChildDelta.apply (cognitive 115) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:660 — SelectSelectNoChildDelta.apply has cognitive complexity 115 (threshold 15). Drivers by points: if/else 27 (54 pts), match/switch 10 (35 pts), boolean chains 26 (nesting depth added 52). 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.
D2 · Cognitive Complexity · 1.fillVector (cognitive 113) · ×1
  • 1.fillVector (cognitive 113) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:302 — 1.fillVector has cognitive complexity 113 (threshold 15). Drivers by points: loops 24 (71 pts), if/else 35 (40 pts), boolean chains 2 (nesting depth added 52). 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.
D2 · Cognitive Complexity · CarbonMergerRDD.internalGetPartitions (cognitive 110) · ×1
  • CarbonMergerRDD.internalGetPartitions (cognitive 110) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:281 — CarbonMergerRDD.internalGetPartitions has cognitive complexity 110 (threshold 15). Drivers by points: if/else 38 (79 pts), loops 6 (14 pts), boolean chains 11, error handling 3 (6 pts) (nesting depth added 52). 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.
D2 · Cognitive Complexity · CarbonDataRDDFactory.loadCarbonData (cognitive 106) · ×1
  • CarbonDataRDDFactory.loadCarbonData (cognitive 106) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala:283 — CarbonDataRDDFactory.loadCarbonData has cognitive complexity 106 (threshold 15). Drivers by points: if/else 38 (81 pts), boolean chains 18, match/switch 1 (4 pts), error handling 2 (3 pts) (nesting depth added 47). 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.
D2 · Cognitive Complexity · RowLevelFilterExecutorImpl.applyFilter (cognitive 91) · ×1
  • RowLevelFilterExecutorImpl.applyFilter (cognitive 91) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:196 — RowLevelFilterExecutorImpl.applyFilter has cognitive complexity 91 (threshold 15). Drivers by points: if/else 23 (50 pts), loops 8 (25 pts), error handling 2 (10 pts), boolean chains 6 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CarbonUtil.setLocalDictColumnsToWrapperSchema (cognitive 90) · ×1
  • CarbonUtil.setLocalDictColumnsToWrapperSchema (cognitive 90) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2927 — CarbonUtil.setLocalDictColumnsToWrapperSchema has cognitive complexity 90 (threshold 15). Drivers by points: if/else 25 (73 pts), boolean chains 10, loops 2 (7 pts) (nesting depth added 53). 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.
D2 · Cognitive Complexity · SecondaryIndexCreator.createSecondaryIndex (cognitive 89) · ×1
  • SecondaryIndexCreator.createSecondaryIndex (cognitive 89) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/rdd/SecondaryIndexCreator.scala:66 — SecondaryIndexCreator.createSecondaryIndex has cognitive complexity 89 (threshold 15). Drivers by points: if/else 37 (59 pts), match/switch 4 (14 pts), loops 4 (8 pts), boolean chains 7, error handling 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilterExecutorUtil.executeIncludeExcludeFilterForMeasure (cognitive 87) · ×1
  • FilterExecutorUtil.executeIncludeExcludeFilterForMeasure (cognitive 87) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExecutorUtil.java:57 — FilterExecutorUtil.executeIncludeExcludeFilterForMeasure has cognitive complexity 87 (threshold 15). Drivers by points: if/else 26 (67 pts), loops 10 (20 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CarbonMergeDataSetCommand.processData (cognitive 82) · ×1
  • CarbonMergeDataSetCommand.processData (cognitive 82) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetCommand.scala:85 — CarbonMergeDataSetCommand.processData has cognitive complexity 82 (threshold 15). Drivers by points: if/else 42 (59 pts), boolean chains 14, match/switch 6 (9 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.
D2 · Cognitive Complexity · CarbonCreateSecondaryIndexCommand.processData (cognitive 78) · ×1
  • CarbonCreateSecondaryIndexCommand.processData (cognitive 78) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/command/SICreationCommand.scala:83 — CarbonCreateSecondaryIndexCommand.processData has cognitive complexity 78 (threshold 15). Drivers by points: if/else 43 (56 pts), boolean chains 14, error handling 4 (5 pts), loops 1 (3 pts) (nesting depth added 16). 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.
D2 · Cognitive Complexity · CarbonLoaderUtil.recordNewLoadMetadata (cognitive 73) · ×1
  • CarbonLoaderUtil.recordNewLoadMetadata (cognitive 73) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:234 — CarbonLoaderUtil.recordNewLoadMetadata has cognitive complexity 73 (threshold 15). Drivers by points: if/else 22 (50 pts), loops 5 (16 pts), boolean chains 7 (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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanEqualFilterExecutorImpl.applyFilter (cognitive 71) · ×1
  • RowLevelRangeGreaterThanEqualFilterExecutorImpl.applyFilter (cognitive 71) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:216 — RowLevelRangeGreaterThanEqualFilterExecutorImpl.applyFilter has cognitive complexity 71 (threshold 15). Drivers by points: if/else 21 (65 pts), loops 2 (4 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanFilterExecutorImpl.applyFilter (cognitive 71) · ×1
  • RowLevelRangeGreaterThanFilterExecutorImpl.applyFilter (cognitive 71) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:274 — RowLevelRangeGreaterThanFilterExecutorImpl.applyFilter has cognitive complexity 71 (threshold 15). Drivers by points: if/else 21 (65 pts), loops 2 (4 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · RangeExpressionEvaluator.replaceWithRangeExpression (cognitive 69) · ×1
  • RangeExpressionEvaluator.replaceWithRangeExpression (cognitive 69) core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.java:109 — RangeExpressionEvaluator.replaceWithRangeExpression has cognitive complexity 69 (threshold 15). Drivers by points: if/else 13 (55 pts), loops 3 (9 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · AlterTableColumnSchemaGenerator.process (cognitive 67) · ×1
  • AlterTableColumnSchemaGenerator.process (cognitive 67) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala:293 — AlterTableColumnSchemaGenerator.process has cognitive complexity 67 (threshold 15). Drivers by points: if/else 32 (54 pts), boolean chains 10, loops 2 (3 pts) (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.
D2 · Cognitive Complexity · GroupbyGroupbyNoChildDelta.apply (cognitive 67) · ×1
  • GroupbyGroupbyNoChildDelta.apply (cognitive 67) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:887 — GroupbyGroupbyNoChildDelta.apply has cognitive complexity 67 (threshold 15). Drivers by points: match/switch 8 (33 pts), if/else 17 (29 pts), boolean chains 5 (nesting depth added 37). 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.
D2 · Cognitive Complexity · MVRefresher.getSpecificSegmentsTobeLoaded (cognitive 66) · ×1
  • MVRefresher.getSpecificSegmentsTobeLoaded (cognitive 66) integration/spark/src/main/scala/org/apache/carbondata/view/MVRefresher.scala:258 — MVRefresher.getSpecificSegmentsTobeLoaded has cognitive complexity 66 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 7 (23 pts), boolean chains 3 (nesting depth added 43). 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.
D2 · Cognitive Complexity · CarbonSecondaryIndexOptimizer.transformFilterToJoin (cognitive 66) · ×1
  • CarbonSecondaryIndexOptimizer.transformFilterToJoin (cognitive 66) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:736 — CarbonSecondaryIndexOptimizer.transformFilterToJoin has cognitive complexity 66 (threshold 15). Drivers by points: if/else 28 (52 pts), boolean chains 8, match/switch 4 (6 pts) (nesting depth added 26). 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.
D2 · Cognitive Complexity · CarbonAlterTableColRenameDataTypeChangeCommand.processMetadata (cognitive 65) · ×1
  • CarbonAlterTableColRenameDataTypeChangeCommand.processMetadata (cognitive 65) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableColRenameDataTypeChangeCommand.scala:88 — CarbonAlterTableColRenameDataTypeChangeCommand.processMetadata has cognitive complexity 65 (threshold 15). Drivers by points: if/else 37 (57 pts), boolean chains 7, 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.
D2 · Cognitive Complexity · CommonLoadUtils.loadDataWithPartition (cognitive 62) · ×1
  • CommonLoadUtils.loadDataWithPartition (cognitive 62) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:869 — CommonLoadUtils.loadDataWithPartition has cognitive complexity 62 (threshold 15). Drivers by points: if/else 30 (44 pts), boolean chains 6, loops 2 (6 pts), match/switch 2 (4 pts), error handling 2 (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.
D2 · Cognitive Complexity · CarbonIndexUtil.processSIRepair (cognitive 60) · ×1
  • CarbonIndexUtil.processSIRepair (cognitive 60) integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala:497 — CarbonIndexUtil.processSIRepair has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (46 pts), boolean chains 6, error handling 2 (5 pts), match/switch 1 (3 pts) (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.
D2 · Cognitive Complexity · AvroCarbonWriter.avroFieldToObjectForUnionType (cognitive 59) · ×1
  • AvroCarbonWriter.avroFieldToObjectForUnionType (cognitive 59) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:405 — AvroCarbonWriter.avroFieldToObjectForUnionType has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 4 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 38). 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.
D2 · Cognitive Complexity · CarbonLoaderUtil.assignBlocksByDataLocality (cognitive 59) · ×1
  • CarbonLoaderUtil.assignBlocksByDataLocality (cognitive 59) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:893 — CarbonLoaderUtil.assignBlocksByDataLocality has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (48 pts), error handling 1 (6 pts), loops 2 (3 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · MVRewrite.updatePlan (cognitive 59) · ×1
  • MVRewrite.updatePlan (cognitive 59) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:734 — MVRewrite.updatePlan has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 7 (19 pts), loops 3 (9 pts), boolean chains 4 (nesting depth added 28). 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.
D2 · Cognitive Complexity · DropIndexCommand.dropIndex (cognitive 58) · ×1
  • DropIndexCommand.dropIndex (cognitive 58) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/DropIndexCommand.scala:76 — DropIndexCommand.dropIndex has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (44 pts), error handling 3 (8 pts), boolean chains 6 (nesting depth added 28). 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.
D2 · Cognitive Complexity · GroupbyGroupbySelectOnlyChildDelta.apply (cognitive 58) · ×1
  • GroupbyGroupbySelectOnlyChildDelta.apply (cognitive 58) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:1082 — GroupbyGroupbySelectOnlyChildDelta.apply has cognitive complexity 58 (threshold 15). Drivers by points: match/switch 9 (28 pts), if/else 14 (23 pts), boolean chains 7 (nesting depth added 28). 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.
D2 · Cognitive Complexity · DeleteLoadFolders.physicalFactAndMeasureMetadataDeletion (cognitive 57) · ×1
  • DeleteLoadFolders.physicalFactAndMeasureMetadataDeletion (cognitive 57) core/src/main/java/org/apache/carbondata/core/util/DeleteLoadFolders.java:106 — DeleteLoadFolders.physicalFactAndMeasureMetadataDeletion has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (41 pts), loops 4 (11 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 38). 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.
D2 · Cognitive Complexity · TableFieldStat.<init> (cognitive 56) · ×1
  • TableFieldStat.<init> (cognitive 56) processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/TableFieldStat.java:97 — TableFieldStat.<init> has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (45 pts), loops 4 (7 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · CarbonInputFormat.getPrunedBlocklets (cognitive 55) · ×1
  • CarbonInputFormat.getPrunedBlocklets (cognitive 55) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java:540 — CarbonInputFormat.getPrunedBlocklets has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 3 (11 pts), error handling 2 (5 pts), boolean chains 3, ternaries 2 (nesting depth added 30). 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.
D2 · Cognitive Complexity · CarbonStreamRecordWriter.write (cognitive 54) · ×1
  • CarbonStreamRecordWriter.write (cognitive 54) streaming/src/main/java/org/apache/carbondata/streaming/CarbonStreamRecordWriter.java:208 — CarbonStreamRecordWriter.write has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (41 pts), loops 4 (8 pts), ternaries 1 (5 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RowLevelRangeLessThanEqualFilterExecutorImpl.applyFilter (cognitive 54) · ×1
  • RowLevelRangeLessThanEqualFilterExecutorImpl.applyFilter (cognitive 54) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:216 — RowLevelRangeLessThanEqualFilterExecutorImpl.applyFilter has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (49 pts), loops 2 (4 pts), boolean chains 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanFilterExecutorImpl.applyFilter (cognitive 54) · ×1
  • RowLevelRangeLessThanFilterExecutorImpl.applyFilter (cognitive 54) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:213 — RowLevelRangeLessThanFilterExecutorImpl.applyFilter has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (49 pts), loops 2 (4 pts), boolean chains 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.
D2 · Cognitive Complexity · CarbonTableCompactor.triggerCompaction (cognitive 54) · ×1
  • CarbonTableCompactor.triggerCompaction (cognitive 54) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonTableCompactor.scala:204 — CarbonTableCompactor.triggerCompaction has cognitive complexity 54 (threshold 15). Drivers by points: if/else 29 (50 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · CarbonProjectForUpdateCommand.processData (cognitive 53) · ×1
  • CarbonProjectForUpdateCommand.processData (cognitive 53) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForUpdateCommand.scala:59 — CarbonProjectForUpdateCommand.processData has cognitive complexity 53 (threshold 15). Drivers by points: if/else 31 (43 pts), boolean chains 5, error handling 3 (4 pts), match/switch 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.
D2 · Cognitive Complexity · CarbonSparkSqlParserUtil.buildTableInfoFromCatalogTable (cognitive 53) · ×1
  • CarbonSparkSqlParserUtil.buildTableInfoFromCatalogTable (cognitive 53) integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala:148 — CarbonSparkSqlParserUtil.buildTableInfoFromCatalogTable has cognitive complexity 53 (threshold 15). Drivers by points: if/else 23 (41 pts), boolean chains 6, loops 1 (3 pts), error handling 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · AvroCarbonWriter.avroFieldToObject (cognitive 51) · ×1
  • AvroCarbonWriter.avroFieldToObject (cognitive 51) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:184 — AvroCarbonWriter.avroFieldToObject has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 6 (15 pts), match/switch 1 (nesting depth added 32). 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.
D2 · Cognitive Complexity · SegmentStatusManager.getValidAndInvalidSegments (cognitive 51) · ×1
  • SegmentStatusManager.getValidAndInvalidSegments (cognitive 51) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:137 — SegmentStatusManager.getValidAndInvalidSegments has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (44 pts), boolean chains 5, error handling 1, 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.
D2 · Cognitive Complexity · CarbonWriterBuilder.buildTableSchema (cognitive 50) · ×1
  • CarbonWriterBuilder.buildTableSchema (cognitive 50) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:1053 — CarbonWriterBuilder.buildTableSchema has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 6 (12 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · CarbonUpdateUtil.updateTableMetadataStatus (cognitive 50) · ×1
  • CarbonUpdateUtil.updateTableMetadataStatus (cognitive 50) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:273 — CarbonUpdateUtil.updateTableMetadataStatus has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (40 pts), loops 2 (5 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 30). 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.
D2 · Cognitive Complexity · RowLevelFilterExecutorImpl.createRow (cognitive 50) · ×1
  • RowLevelFilterExecutorImpl.createRow (cognitive 50) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:443 — RowLevelFilterExecutorImpl.createRow has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (41 pts), error handling 1 (3 pts), boolean chains 2, loops 2, ternaries 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.
D2 · Cognitive Complexity · SelectSelectGroupbyChildDelta.doTopSelectTranslation (cognitive 50) · ×1
  • SelectSelectGroupbyChildDelta.doTopSelectTranslation (cognitive 50) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:1306 — SelectSelectGroupbyChildDelta.doTopSelectTranslation has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (25 pts), match/switch 7 (22 pts), boolean chains 3 (nesting depth added 22). 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.
D2 · Cognitive Complexity · CarbonDataset.__init__ (cognitive 50) · ×1
  • CarbonDataset.__init__ (cognitive 50) python/pycarbon/core/carbon.py:32 — CarbonDataset.__init__ has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (36 pts), error handling 3 (7 pts), loops 2 (4 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · MVRefresher.refresh (cognitive 49) · ×1
  • MVRefresher.refresh (cognitive 49) integration/spark/src/main/scala/org/apache/carbondata/view/MVRefresher.scala:59 — MVRefresher.refresh has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 3 (9 pts), boolean chains 4, error handling 1 (2 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.
D2 · Cognitive Complexity · SortState.mergeHi (cognitive 48) · ×1
  • SortState.mergeHi (cognitive 48) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:833 — SortState.mergeHi has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (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. This shape REPEATS in the file: one other method here (SortState.mergeLo) 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.
D2 · Cognitive Complexity · SortState.mergeLo (cognitive 48) · ×1
  • SortState.mergeLo (cognitive 48) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:706 — SortState.mergeLo has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (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. This shape REPEATS in the file: one other method here (SortState.mergeHi) 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.
D2 · Cognitive Complexity · CarbonMergeDataSetCommand.generateStatusColumnWithAllCombinations (cognitive 48) · ×1
  • CarbonMergeDataSetCommand.generateStatusColumnWithAllCombinations (cognitive 48) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetCommand.scala:686 — CarbonMergeDataSetCommand.generateStatusColumnWithAllCombinations has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (41 pts), match/switch 1 (4 pts), loops 2 (3 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.
D2 · Cognitive Complexity · CarbonInternalMetastore.refreshIndexInfo (cognitive 48) · ×1
  • CarbonInternalMetastore.refreshIndexInfo (cognitive 48) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/hive/CarbonInternalMetastore.scala:151 — CarbonInternalMetastore.refreshIndexInfo has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · DataLoadProcessBuilder.getReArrangedDataFields (cognitive 47) · ×1
  • DataLoadProcessBuilder.getReArrangedDataFields (cognitive 47) processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:321 — DataLoadProcessBuilder.getReArrangedDataFields has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (34 pts), loops 5 (10 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · MVRewrite.rewrite (cognitive 47) · ×1
  • MVRewrite.rewrite (cognitive 47) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:234 — MVRewrite.rewrite has cognitive complexity 47 (threshold 15). Drivers by points: match/switch 7 (31 pts), if/else 6 (16 pts) (nesting depth added 34). 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.
D2 · Cognitive Complexity · PrimitiveDataType.writeByteArray (cognitive 46) · ×1
  • PrimitiveDataType.writeByteArray (cognitive 46) processing/src/main/java/org/apache/carbondata/processing/datatypes/PrimitiveDataType.java:239 — PrimitiveDataType.writeByteArray has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 10, 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.
D2 · Cognitive Complexity · RangeValueFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 46) · ×1
  • RangeValueFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 46) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:564 — RangeValueFilterExecutorImpl.setFilteredIndexToBitSet has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 2, loops 1 (2 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.
D2 · Cognitive Complexity · MergeIndexEventListener.onEvent (cognitive 46) · ×1
  • MergeIndexEventListener.onEvent (cognitive 46) integration/spark/src/main/scala/org/apache/spark/sql/events/MergeIndexEventListener.scala:44 — MergeIndexEventListener.onEvent has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (43 pts), boolean chains 2, match/switch 1 (nesting depth added 25). 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.
D2 · Cognitive Complexity · CarbonReader.getFormattedData (cognitive 45) · ×1
  • CarbonReader.getFormattedData (cognitive 45) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java:135 — CarbonReader.getFormattedData has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (17 pts), boolean chains 3 (nesting depth added 28). 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.
D2 · Cognitive Complexity · CarbonInternalLoaderUtil.recordLoadMetadata (cognitive 45) · ×1
  • CarbonInternalLoaderUtil.recordLoadMetadata (cognitive 45) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:91 — CarbonInternalLoaderUtil.recordLoadMetadata has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 6 (16 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · CarbonCreateMVCommand.doCreate (cognitive 45) · ×1
  • CarbonCreateMVCommand.doCreate (cognitive 45) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/view/CarbonCreateMVCommand.scala:156 — CarbonCreateMVCommand.doCreate has cognitive complexity 45 (threshold 15). Drivers by points: if/else 28 (37 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 9). 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.
D2 · Cognitive Complexity · TableSchemaBuilder.addColumn (cognitive 44) · ×1
  • TableSchemaBuilder.addColumn (cognitive 44) core/src/main/java/org/apache/carbondata/core/metadata/schema/table/TableSchemaBuilder.java:163 — TableSchemaBuilder.addColumn has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (30 pts), loops 3 (10 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · CarbonUpdateUtil.cleanUpDeltaFiles (cognitive 44) · ×1
  • CarbonUpdateUtil.cleanUpDeltaFiles (cognitive 44) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:713 — CarbonUpdateUtil.cleanUpDeltaFiles has cognitive complexity 44 (threshold 15). Drivers by points: loops 8 (22 pts), if/else 9 (19 pts), boolean chains 3 (nesting depth added 24). 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 44) · ×1
  • RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 44) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:532 — RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSet has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 4 (10 pts), boolean chains 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.
D2 · Cognitive Complexity · DataTypeUtil.createTimeInstant (cognitive 44) · ×1
  • DataTypeUtil.createTimeInstant (cognitive 44) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:450 — DataTypeUtil.createTimeInstant has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 9, loops 4 (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.
D2 · Cognitive Complexity · CarbonCreateMVCommand.checkTimeSeriesQuery (cognitive 44) · ×1
  • CarbonCreateMVCommand.checkTimeSeriesQuery (cognitive 44) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/view/CarbonCreateMVCommand.scala:632 — CarbonCreateMVCommand.checkTimeSeriesQuery has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 4 (14 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSegCount (cognitive 43) · ×1
  • CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSegCount (cognitive 43) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:610 — CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSegCount has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 5, ternaries 1 (2 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.
D2 · Cognitive Complexity · MVRewrite.getRolledUpModularPlan (cognitive 43) · ×1
  • MVRewrite.getRolledUpModularPlan (cognitive 43) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:122 — MVRewrite.getRolledUpModularPlan has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 6 (13 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · TablePage.<init> (cognitive 42) · ×1
  • TablePage.<init> (cognitive 42) processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java:91 — TablePage.<init> has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (37 pts), loops 4, 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.
D2 · Cognitive Complexity · CarbonIndexFileMergeWriter.writeMergeIndexFileBasedOnSegmentFile (cognitive 42) · ×1
  • CarbonIndexFileMergeWriter.writeMergeIndexFileBasedOnSegmentFile (cognitive 42) core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileMergeWriter.java:227 — CarbonIndexFileMergeWriter.writeMergeIndexFileBasedOnSegmentFile has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (13 pts), error handling 2 (7 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.
D2 · Cognitive Complexity · CarbonScanRDD.internalCompute (cognitive 42) · ×1
  • CarbonScanRDD.internalCompute (cognitive 42) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:461 — CarbonScanRDD.internalCompute has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (34 pts), error handling 1 (3 pts), match/switch 1 (3 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · RowLevelRangeLessThanEqualFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 41) · ×1
  • RowLevelRangeLessThanEqualFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 41) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:528 — RowLevelRangeLessThanEqualFilterExecutorImpl.setFilteredIndexToBitSet has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 4 (10 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.
D2 · Cognitive Complexity · SecondaryIndexQueryResultProcessor.prepareRowObjectForSorting (cognitive 40) · ×1
  • SecondaryIndexQueryResultProcessor.prepareRowObjectForSorting (cognitive 40) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/query/SecondaryIndexQueryResultProcessor.java:261 — SecondaryIndexQueryResultProcessor.prepareRowObjectForSorting has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 4 (10 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · SegmentFileStore.cleanSegments (cognitive 40) · ×1
  • SegmentFileStore.cleanSegments (cognitive 40) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:1093 — SegmentFileStore.cleanSegments has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (15 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · RangeValueFilterExecutorImpl.applyNoAndDirectFilter (cognitive 40) · ×1
  • RangeValueFilterExecutorImpl.applyNoAndDirectFilter (cognitive 40) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:373 — RangeValueFilterExecutorImpl.applyNoAndDirectFilter has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 1 (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.
D2 · Cognitive Complexity · FilterExpressionProcessor.getFilterResolverBasedOnExpressionType (cognitive 40) · ×1
  • FilterExpressionProcessor.getFilterResolverBasedOnExpressionType (cognitive 40) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java:174 — FilterExpressionProcessor.getFilterResolverBasedOnExpressionType has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 9, match/switch 1 (nesting depth added 19). 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.
D2 · Cognitive Complexity · SessionParams.validateKeyValue (cognitive 40) · ×1
  • SessionParams.validateKeyValue (cognitive 40) core/src/main/java/org/apache/carbondata/core/util/SessionParams.java:128 — SessionParams.validateKeyValue has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 4, error handling 1 (2 pts), match/switch 1 (nesting depth added 15). 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.
D2 · Cognitive Complexity · DMLStrategy.apply (cognitive 40) · ×1
  • DMLStrategy.apply (cognitive 40) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/DMLStrategy.scala:54 — DMLStrategy.apply has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 6 (15 pts), boolean chains 7 (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.
D2 · Cognitive Complexity · SelectSelectGroupbyChildDelta.apply (cognitive 40) · ×1
  • SelectSelectGroupbyChildDelta.apply (cognitive 40) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:1445 — SelectSelectGroupbyChildDelta.apply has cognitive complexity 40 (threshold 15). Drivers by points: match/switch 9 (28 pts), if/else 6 (7 pts), boolean chains 5 (nesting depth added 20). 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.
D2 · Cognitive Complexity · CarbonTableInputFormat.getBlockRowCount (cognitive 39) · ×1
  • CarbonTableInputFormat.getBlockRowCount (cognitive 39) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java:438 — CarbonTableInputFormat.getBlockRowCount has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 4 (7 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · DecimalIntConverter.fillVector (cognitive 39) · ×1
  • DecimalIntConverter.fillVector (cognitive 39) core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java:113 — DecimalIntConverter.fillVector has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 2 (4 pts), boolean chains 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.
D2 · Cognitive Complexity · CarbonMergeFilesRDD.mergeIndexFiles (cognitive 39) · ×1
  • CarbonMergeFilesRDD.mergeIndexFiles (cognitive 39) integration/spark/src/main/scala/org/apache/spark/rdd/CarbonMergeFilesRDD.scala:70 — CarbonMergeFilesRDD.mergeIndexFiles has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 4, error handling 1 (2 pts) (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.
D2 · Cognitive Complexity · CarbonPlanHelper.makeDeterministic (cognitive 39) · ×1
  • CarbonPlanHelper.makeDeterministic (cognitive 39) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonPlanHelper.scala:197 — CarbonPlanHelper.makeDeterministic has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 5 (17 pts), if/else 8 (16 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · DataTypeUtil.getDataBasedOnDataType (cognitive 38) · ×1
  • DataTypeUtil.getDataBasedOnDataType (cognitive 38) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:312 — DataTypeUtil.getDataBasedOnDataType has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (32 pts), error handling 3 (5 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.
D2 · Cognitive Complexity · DataTypeUtil.getDataBasedOnDataTypeForNoDictionaryColumn (cognitive 38) · ×1
  • DataTypeUtil.getDataBasedOnDataTypeForNoDictionaryColumn (cognitive 38) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:716 — DataTypeUtil.getDataBasedOnDataTypeForNoDictionaryColumn has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · CarbonInsertIntoCommand.getReArrangedLogicalPlan (cognitive 38) · ×1
  • CarbonInsertIntoCommand.getReArrangedLogicalPlan (cognitive 38) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:329 — CarbonInsertIntoCommand.getReArrangedLogicalPlan has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 3 (8 pts), match/switch 2, boolean chains 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.
D2 · Cognitive Complexity · CarbonCreateTableCommand.processMetadata (cognitive 38) · ×1
  • CarbonCreateTableCommand.processMetadata (cognitive 38) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableCommand.scala:47 — CarbonCreateTableCommand.processMetadata has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (27 pts), error handling 3 (10 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · CarbonFilesystemResolver.__init__ (cognitive 38) · ×1
  • CarbonFilesystemResolver.__init__ (cognitive 38) python/pycarbon/core/carbon_fs_utils.py:27 — CarbonFilesystemResolver.__init__ has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 3 (6 pts), boolean chains 3, error handling 1 (2 pts) (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.
D2 · Cognitive Complexity · VectorizedCarbonRecordReader.initBatch (cognitive 37) · ×1
  • VectorizedCarbonRecordReader.initBatch (cognitive 37) integration/spark/src/main/java/org/apache/carbondata/spark/vectorreader/VectorizedCarbonRecordReader.java:217 — VectorizedCarbonRecordReader.initBatch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 6 (10 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · CastExpressionOptimization.typeCastStringToLong (cognitive 37) · ×1
  • CastExpressionOptimization.typeCastStringToLong (cognitive 37) integration/spark/src/main/scala/org/apache/spark/sql/execution/CastExpressionOptimization.scala:43 — CastExpressionOptimization.typeCastStringToLong has cognitive complexity 37 (threshold 15). Drivers by points: error handling 6 (24 pts), if/else 8 (12 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.
D2 · Cognitive Complexity · CarbonLoaderUtil.nodeBlockMapping (cognitive 36) · ×1
  • CarbonLoaderUtil.nodeBlockMapping (cognitive 36) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:546 — CarbonLoaderUtil.nodeBlockMapping has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 3 (8 pts), loops 3 (4 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.
D2 · Cognitive Complexity · CarbonAntlrSqlVisitor.visitMergeIntoCarbonTable (cognitive 36) · ×1
  • CarbonAntlrSqlVisitor.visitMergeIntoCarbonTable (cognitive 36) integration/spark/src/main/java/org/apache/spark/sql/CarbonAntlrSqlVisitor.java:144 — CarbonAntlrSqlVisitor.visitMergeIntoCarbonTable has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 3 (11 pts), loops 2 (5 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.
D2 · Cognitive Complexity · TableIndex.pruneWithFilter (cognitive 36) · ×1
  • TableIndex.pruneWithFilter (cognitive 36) core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:206 — TableIndex.pruneWithFilter has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 3 (7 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · RestructureUtil.createDimensionInfoAndGetCurrentBlockQueryDimension (cognitive 36) · ×1
  • RestructureUtil.createDimensionInfoAndGetCurrentBlockQueryDimension (cognitive 36) core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:73 — RestructureUtil.createDimensionInfoAndGetCurrentBlockQueryDimension has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 3 (7 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.
D2 · Cognitive Complexity · BlockletScannedResult.freeMemory (cognitive 36) · ×1
  • BlockletScannedResult.freeMemory (cognitive 36) core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java:692 — BlockletScannedResult.freeMemory has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 5 (14 pts) (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.
D2 · Cognitive Complexity · CarbonUtil.calculateDataIndexSize (cognitive 36) · ×1
  • CarbonUtil.calculateDataIndexSize (cognitive 36) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2423 — CarbonUtil.calculateDataIndexSize has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 3, loops 1 (3 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.
D2 · Cognitive Complexity · CarbonCreateIndexCommand.processMetadata (cognitive 35) · ×1
  • CarbonCreateIndexCommand.processMetadata (cognitive 35) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/CarbonCreateIndexCommand.scala:62 — CarbonCreateIndexCommand.processMetadata has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · CarbonInsertIntoCommand.processData (cognitive 35) · ×1
  • CarbonInsertIntoCommand.processData (cognitive 35) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:126 — CarbonInsertIntoCommand.processData has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · AvroCarbonWriter.getMappingDataTypeForCollectionRecord (cognitive 34) · ×1
  • AvroCarbonWriter.getMappingDataTypeForCollectionRecord (cognitive 34) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:749 — AvroCarbonWriter.getMappingDataTypeForCollectionRecord has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 15). 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.
D2 · Cognitive Complexity · CarbonFileInputFormat.getSplits (cognitive 34) · ×1
  • CarbonFileInputFormat.getSplits (cognitive 34) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonFileInputFormat.java:107 — CarbonFileInputFormat.getSplits has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 3 (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.
D2 · Cognitive Complexity · SegmentFileStore.getIndexAndMergeFiles (cognitive 34) · ×1
  • SegmentFileStore.getIndexAndMergeFiles (cognitive 34) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:948 — SegmentFileStore.getIndexAndMergeFiles has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 2 (7 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 34) · ×1
  • RowLevelRangeGreaterThanFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 34) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:533 — RowLevelRangeGreaterThanFilterExecutorImpl.setFilteredIndexToBitSet has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (10 pts), boolean chains 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.
D2 · Cognitive Complexity · DataTypeUtil.getDataBasedOnDataType (cognitive 34) · ×1
  • DataTypeUtil.getDataBasedOnDataType (cognitive 34) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:814 — DataTypeUtil.getDataBasedOnDataType has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (28 pts), error handling 3 (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.
D2 · Cognitive Complexity · MVProvider.isViewCanBeEnabled (cognitive 34) · ×1
  • MVProvider.isViewCanBeEnabled (cognitive 34) core/src/main/java/org/apache/carbondata/core/view/MVProvider.java:346 — MVProvider.isViewCanBeEnabled has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (6 pts) (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.
D2 · Cognitive Complexity · CarbonParserUtil.prepareTableModel (cognitive 34) · ×1
  • CarbonParserUtil.prepareTableModel (cognitive 34) integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:210 — CarbonParserUtil.prepareTableModel has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · CarbonParserUtil.validateOptions (cognitive 34) · ×1
  • CarbonParserUtil.validateOptions (cognitive 34) integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:919 — CarbonParserUtil.validateOptions has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · CarbonCompactionUtil.getOverallMinMax (cognitive 33) · ×1
  • CarbonCompactionUtil.getOverallMinMax (cognitive 33) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonCompactionUtil.java:457 — CarbonCompactionUtil.getOverallMinMax has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (4 pts), boolean chains 2, error handling 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.
D2 · Cognitive Complexity · CarbonFactDataHandlerColumnar.needToCutThePage (cognitive 33) · ×1
  • CarbonFactDataHandlerColumnar.needToCutThePage (cognitive 33) processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerColumnar.java:278 — CarbonFactDataHandlerColumnar.needToCutThePage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (11 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · ColumnPageWrapper.getChunkDataInBytes (cognitive 33) · ×1
  • ColumnPageWrapper.getChunkDataInBytes (cognitive 33) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/ColumnPageWrapper.java:110 — ColumnPageWrapper.getChunkDataInBytes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 7 (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.
D2 · Cognitive Complexity · 1.call (cognitive 33) · ×1
  • 1.call (cognitive 33) core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:368 — 1.call has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 3 (7 pts), boolean chains 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.
D2 · Cognitive Complexity · SegmentStatusManager.deleteLoadsAndUpdateMetadata (cognitive 33) · ×1
  • SegmentStatusManager.deleteLoadsAndUpdateMetadata (cognitive 33) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:1124 — SegmentStatusManager.deleteLoadsAndUpdateMetadata has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 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.
D2 · Cognitive Complexity · CarbonShowCacheCommand.getAllTablesCache (cognitive 33) · ×1
  • CarbonShowCacheCommand.getAllTablesCache (cognitive 33) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala:150 — CarbonShowCacheCommand.getAllTablesCache has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (17 pts), error handling 4 (6 pts), boolean chains 5, match/switch 2 (5 pts) (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.
D2 · Cognitive Complexity · DeleteExecution.deleteDeltaExecutionInternal (cognitive 33) · ×1
  • DeleteExecution.deleteDeltaExecutionInternal (cognitive 33) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/DeleteExecution.scala:94 — DeleteExecution.deleteDeltaExecutionInternal has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (24 pts), match/switch 2 (3 pts), boolean chains 2, error handling 2, loops 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.
D2 · Cognitive Complexity · SecondaryIndexUtil.triggerCompaction (cognitive 33) · ×1
  • SecondaryIndexUtil.triggerCompaction (cognitive 33) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/util/SecondaryIndexUtil.scala:159 — SecondaryIndexUtil.triggerCompaction has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (20 pts), error handling 3 (8 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · AddSubquery.apply (cognitive 33) · ×1
  • AddSubquery.apply (cognitive 33) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/SQLBuilder.scala:143 — AddSubquery.apply has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 7 (18 pts), if/else 8 (13 pts), boolean chains 2 (nesting depth added 16). 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.
D2 · Cognitive Complexity · DataSummary.printColumnStats (cognitive 32) · ×1
  • DataSummary.printColumnStats (cognitive 32) tools/cli/src/main/java/org/apache/carbondata/tool/DataSummary.java:293 — DataSummary.printColumnStats has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 4, loops 2 (3 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.
D2 · Cognitive Complexity · AvroCarbonWriter.prepareFields (cognitive 32) · ×1
  • AvroCarbonWriter.prepareFields (cognitive 32) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:541 — AvroCarbonWriter.prepareFields has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 15). 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.
D2 · Cognitive Complexity · NonDictionaryFieldConverterImpl.convert (cognitive 32) · ×1
  • NonDictionaryFieldConverterImpl.convert (cognitive 32) processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/NonDictionaryFieldConverterImpl.java:63 — NonDictionaryFieldConverterImpl.convert has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 6, error handling 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.
D2 · Cognitive Complexity · BadRecordsLogger.addBadRecordsToBuilder (cognitive 32) · ×1
  • BadRecordsLogger.addBadRecordsToBuilder (cognitive 32) processing/src/main/java/org/apache/carbondata/processing/loading/BadRecordsLogger.java:129 — BadRecordsLogger.addBadRecordsToBuilder has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · CarbonTable.getIndexInfo (cognitive 32) · ×1
  • CarbonTable.getIndexInfo (cognitive 32) core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:1189 — CarbonTable.getIndexInfo has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (14 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.
D2 · Cognitive Complexity · RestructureBasedRawResultCollector.fillNoDictionaryAndComplexKeyArrayBatchWithLatestSchema (cognitive 32) · ×1
  • RestructureBasedRawResultCollector.fillNoDictionaryAndComplexKeyArrayBatchWithLatestSchema (cognitive 32) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedRawResultCollector.java:132 — RestructureBasedRawResultCollector.fillNoDictionaryAndComplexKeyArrayBatchWithLatestSchema has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 1 (6 pts), loops 2 (3 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.
D2 · Cognitive Complexity · CarbonDescribeFormattedCommand.processMetadata (cognitive 32) · ×1
  • CarbonDescribeFormattedCommand.processMetadata (cognitive 32) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala:52 — CarbonDescribeFormattedCommand.processMetadata has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25 (32 pts) (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.
D2 · Cognitive Complexity · CarbonDescribeColumnCommand.processMetadata (cognitive 32) · ×1
  • CarbonDescribeColumnCommand.processMetadata (cognitive 32) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala:406 — CarbonDescribeColumnCommand.processMetadata has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 1 (4 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.
D2 · Cognitive Complexity · BroadCastSIFilterPushJoin.getFilteredSegments (cognitive 32) · ×1
  • BroadCastSIFilterPushJoin.getFilteredSegments (cognitive 32) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/joins/BroadCastSIFilterPushJoin.scala:265 — BroadCastSIFilterPushJoin.getFilteredSegments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 2 (7 pts), loops 3 (7 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.
D2 · Cognitive Complexity · MeasureFieldConverterImpl.convert (cognitive 31) · ×1
  • MeasureFieldConverterImpl.convert (cognitive 31) processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/MeasureFieldConverterImpl.java:65 — MeasureFieldConverterImpl.convert has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (28 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · BloomCoarseGrainIndex.prune (cognitive 31) · ×1
  • BloomCoarseGrainIndex.prune (cognitive 31) index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomCoarseGrainIndex.java:134 — BloomCoarseGrainIndex.prune has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · CarbonOutputCommitter.commitJob (cognitive 31) · ×1
  • CarbonOutputCommitter.commitJob (cognitive 31) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonOutputCommitter.java:106 — CarbonOutputCommitter.commitJob has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), error handling 3 (6 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.
D2 · Cognitive Complexity · AbstractQueryExecutor.getDataBlocks (cognitive 31) · ×1
  • AbstractQueryExecutor.getDataBlocks (cognitive 31) core/src/main/java/org/apache/carbondata/core/scan/executor/impl/AbstractQueryExecutor.java:184 — AbstractQueryExecutor.getDataBlocks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2, 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.
D2 · Cognitive Complexity · RestructureUtil.isColumnMatchesStruct (cognitive 31) · ×1
  • RestructureUtil.isColumnMatchesStruct (cognitive 31) core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java:269 — RestructureUtil.isColumnMatchesStruct has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 4, loops 1 (2 pts) (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.
D2 · Cognitive Complexity · IncludeFilterExecutorImpl.applyFilter (cognitive 31) · ×1
  • IncludeFilterExecutorImpl.applyFilter (cognitive 31) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:103 — IncludeFilterExecutorImpl.applyFilter has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 2 (4 pts) (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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanEqualFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 31) · ×1
  • RowLevelRangeGreaterThanEqualFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 31) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:528 — RowLevelRangeGreaterThanEqualFilterExecutorImpl.setFilteredIndexToBitSet has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (10 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.
D2 · Cognitive Complexity · UnsafeComparer.compareTo (cognitive 31) · ×1
  • UnsafeComparer.compareTo (cognitive 31) core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:219 — UnsafeComparer.compareTo has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), ternaries 1 (5 pts), loops 2 (3 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.
D2 · Cognitive Complexity · CarbonUtil.getFormatVersion (cognitive 31) · ×1
  • CarbonUtil.getFormatVersion (cognitive 31) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:3148 — CarbonUtil.getFormatVersion has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (9 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.
D2 · Cognitive Complexity · CarbonMergeIntoSQLCommand.processData (cognitive 31) · ×1
  • CarbonMergeIntoSQLCommand.processData (cognitive 31) REDACTED:35 — CarbonMergeIntoSQLCommand.processData has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (9 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · TableStatusRecovery.main (cognitive 31) · ×1
  • TableStatusRecovery.main (cognitive 31) integration/spark/src/main/scala/org/apache/carbondata/recovery/tablestatus/TableStatusRecovery.scala:40 — TableStatusRecovery.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 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.
D2 · Cognitive Complexity · CarbonScanRDD.internalGetPartitions (cognitive 31) · ×1
  • CarbonScanRDD.internalGetPartitions (cognitive 31) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:115 — CarbonScanRDD.internalGetPartitions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 3, match/switch 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.
D2 · Cognitive Complexity · AlterTableMergeIndexSIEventListener.onEvent (cognitive 31) · ×1
  • AlterTableMergeIndexSIEventListener.onEvent (cognitive 31) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/AlterTableMergeIndexSIEventListener.scala:48 — AlterTableMergeIndexSIEventListener.onEvent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 1 (5 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.
D2 · Cognitive Complexity · CarbonSecondaryIndexOptimizer.rewritePlanForSecondaryIndex (cognitive 31) · ×1
  • CarbonSecondaryIndexOptimizer.rewritePlanForSecondaryIndex (cognitive 31) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:84 — CarbonSecondaryIndexOptimizer.rewritePlanForSecondaryIndex has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 7 (14 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.
D2 · Cognitive Complexity · AggregatePushDown.transformAggregate (cognitive 31) · ×1
  • AggregatePushDown.transformAggregate (cognitive 31) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/modular/AggregatePushDown.scala:83 — AggregatePushDown.transformAggregate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 8, match/switch 1 (nesting depth added 7). 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.
D2 · Cognitive Complexity · CarbonLoadModelBuilder.build (cognitive 30) · ×1
  • CarbonLoadModelBuilder.build (cognitive 30) processing/src/main/java/org/apache/carbondata/processing/loading/model/CarbonLoadModelBuilder.java:147 — CarbonLoadModelBuilder.build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 2 (5 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.
D2 · Cognitive Complexity · InputProcessorIterator.convertToNoDictionaryToBytes (cognitive 30) · ×1
  • InputProcessorIterator.convertToNoDictionaryToBytes (cognitive 30) processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:367 — InputProcessorIterator.convertToNoDictionaryToBytes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · DataTypeUtil.convertHiveTypeToCarbon (cognitive 30) · ×1
  • DataTypeUtil.convertHiveTypeToCarbon (cognitive 30) integration/hive/src/main/java/org/apache/carbondata/hive/util/DataTypeUtil.java:33 — DataTypeUtil.convertHiveTypeToCarbon has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21 (25 pts), loops 2 (4 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, 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.
D2 · Cognitive Complexity · SafeFixLengthColumnPage.ensureArraySize (cognitive 30) · ×1
  • SafeFixLengthColumnPage.ensureArraySize (cognitive 30) core/src/main/java/org/apache/carbondata/core/datastore/page/SafeFixLengthColumnPage.java:426 — SafeFixLengthColumnPage.ensureArraySize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (27 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.
D2 · Cognitive Complexity · RestructureEvaluatorImpl.isDimensionDefaultValuePresentInFilterValues (cognitive 30) · ×1
  • RestructureEvaluatorImpl.isDimensionDefaultValuePresentInFilterValues (cognitive 30) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RestructureEvaluatorImpl.java:52 — RestructureEvaluatorImpl.isDimensionDefaultValuePresentInFilterValues has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 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.
D2 · Cognitive Complexity · SegmentStatusManager.updateDeletionStatus (cognitive 30) · ×1
  • SegmentStatusManager.updateDeletionStatus (cognitive 30) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:464 — SegmentStatusManager.updateDeletionStatus has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (29 pts), error handling 1 (nesting depth added 17). 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.
D2 · Cognitive Complexity · CarbonHiveMetastoreListener.onEvent (cognitive 30) · ×1
  • CarbonHiveMetastoreListener.onEvent (cognitive 30) integration/hive/src/main/scala/org/apache/carbondata/hive/CarbonHiveMetastoreListener.scala:31 — CarbonHiveMetastoreListener.onEvent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 6, match/switch 1 (nesting depth added 15). 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.
D2 · Cognitive Complexity · CarbonAddLoadCommand.processMetadata (cognitive 30) · ×1
  • CarbonAddLoadCommand.processMetadata (cognitive 30) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAddLoadCommand.scala:74 — CarbonAddLoadCommand.processMetadata has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 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.
D2 · Cognitive Complexity · PaginationCarbonReader.getRows (cognitive 29) · ×1
  • PaginationCarbonReader.getRows (cognitive 29) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/PaginationCarbonReader.java:158 — PaginationCarbonReader.getRows has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (14 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.
D2 · Cognitive Complexity · CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnLoadedDate (cognitive 29) · ×1
  • CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnLoadedDate (cognitive 29) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:380 — CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnLoadedDate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 2 (4 pts), loops 2 (4 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.
D2 · Cognitive Complexity · StreamRecordReader.nextRow (cognitive 29) · ×1
  • StreamRecordReader.nextRow (cognitive 29) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:269 — StreamRecordReader.nextRow has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (27 pts), error handling 1, loops 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.
D2 · Cognitive Complexity · RangeValueFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex (cognitive 29) · ×1
  • RangeValueFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex (cognitive 29) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:462 — RangeValueFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · CarbonUtil.getDataSizeAndIndexSize (cognitive 29) · ×1
  • CarbonUtil.getDataSizeAndIndexSize (cognitive 29) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2507 — CarbonUtil.getDataSizeAndIndexSize has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (7 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · CarbonScanRDD.distributeColumnarSplits (cognitive 29) · ×1
  • CarbonScanRDD.distributeColumnarSplits (cognitive 29) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala:270 — CarbonScanRDD.distributeColumnarSplits has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · CommonLoadUtils.transformQuery (cognitive 29) · ×1
  • CommonLoadUtils.transformQuery (cognitive 29) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:453 — CommonLoadUtils.transformQuery has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (19 pts), match/switch 2 (6 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). 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.
D2 · Cognitive Complexity · AlterTableUtil.modifyTableProperties (cognitive 29) · ×1
  • AlterTableUtil.modifyTableProperties (cognitive 29) integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala:422 — AlterTableUtil.modifyTableProperties has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · SQLFragmentCompactPrinter.printFragment (cognitive 29) · ×1
  • SQLFragmentCompactPrinter.printFragment (cognitive 29) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Printers.scala:249 — SQLFragmentCompactPrinter.printFragment has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 4 (7 pts) (nesting depth added 14). 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.
D2 · Cognitive Complexity · CarbonWriterBuilder.withLoadOptions (cognitive 28) · ×1
  • CarbonWriterBuilder.withLoadOptions (cognitive 28) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:226 — CarbonWriterBuilder.withLoadOptions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, error handling 1 (3 pts), loops 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.
D2 · Cognitive Complexity · RowResultMergerProcessor.execute (cognitive 28) · ×1
  • RowResultMergerProcessor.execute (cognitive 28) processing/src/main/java/org/apache/carbondata/processing/merger/RowResultMergerProcessor.java:109 — RowResultMergerProcessor.execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 3 (4 pts), error handling 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.
D2 · Cognitive Complexity · SegmentIndexFileStore.readAllIIndexOfSegment (cognitive 28) · ×1
  • SegmentIndexFileStore.readAllIIndexOfSegment (cognitive 28) core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/SegmentIndexFileStore.java:132 — SegmentIndexFileStore.readAllIIndexOfSegment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (5 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanEqualFilterExecutorImpl.prunePages (cognitive 28) · ×1
  • RowLevelRangeGreaterThanEqualFilterExecutorImpl.prunePages (cognitive 28) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:343 — RowLevelRangeGreaterThanEqualFilterExecutorImpl.prunePages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanFilterExecutorImpl.prunePages (cognitive 28) · ×1
  • RowLevelRangeGreaterThanFilterExecutorImpl.prunePages (cognitive 28) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:156 — RowLevelRangeGreaterThanFilterExecutorImpl.prunePages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanEqualFilterExecutorImpl.prunePages (cognitive 28) · ×1
  • RowLevelRangeLessThanEqualFilterExecutorImpl.prunePages (cognitive 28) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:322 — RowLevelRangeLessThanEqualFilterExecutorImpl.prunePages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanFilterExecutorImpl.prunePages (cognitive 28) · ×1
  • RowLevelRangeLessThanFilterExecutorImpl.prunePages (cognitive 28) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:318 — RowLevelRangeLessThanFilterExecutorImpl.prunePages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 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.
D2 · Cognitive Complexity · AbstractDataFileFooterConverter.getBlockletIndexForDataFileFooter (cognitive 28) · ×1
  • AbstractDataFileFooterConverter.getBlockletIndexForDataFileFooter (cognitive 28) core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java:234 — AbstractDataFileFooterConverter.getBlockletIndexForDataFileFooter has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 2 (3 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.
D2 · Cognitive Complexity · CarbonParserUtil.extractDimAndMsrFields (cognitive 28) · ×1
  • CarbonParserUtil.extractDimAndMsrFields (cognitive 28) integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:650 — CarbonParserUtil.extractDimAndMsrFields has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · CarbonAddLoadCommand.writeMetaForSegment (cognitive 28) · ×1
  • CarbonAddLoadCommand.writeMetaForSegment (cognitive 28) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAddLoadCommand.scala:227 — CarbonAddLoadCommand.writeMetaForSegment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · CarbonAlterTableCompactionCommand.processData (cognitive 28) · ×1
  • CarbonAlterTableCompactionCommand.processData (cognitive 28) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala:93 — CarbonAlterTableCompactionCommand.processData has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · CarbonMergeDataSetUtil.getFilesToScan (cognitive 28) · ×1
  • CarbonMergeDataSetUtil.getFilesToScan (cognitive 28) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetUtil.scala:243 — CarbonMergeDataSetUtil.getFilesToScan has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (25 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.
D2 · Cognitive Complexity · FieldConverter.objectToString (cognitive 28) · ×1
  • FieldConverter.objectToString (cognitive 28) streaming/src/main/scala/org/apache/carbondata/streaming/parser/FieldConverter.scala:41 — FieldConverter.objectToString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 1 (3 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · RowConverterImpl.convert (cognitive 27) · ×1
  • RowConverterImpl.convert (cognitive 27) processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/RowConverterImpl.java:113 — RowConverterImpl.convert has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · UnsafeRowComparator.compare (cognitive 27) · ×1
  • UnsafeRowComparator.compare (cognitive 27) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/comparator/UnsafeRowComparator.java:54 — UnsafeRowComparator.compare has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (26 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.
D2 · Cognitive Complexity · TablePage.convertToColumnarAndAddToPages (cognitive 27) · ×1
  • TablePage.convertToColumnarAndAddToPages (cognitive 27) processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java:205 — TablePage.convertToColumnarAndAddToPages has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 11). 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.
D2 · Cognitive Complexity · IndexTableUtil.checkAndAddIndexTable (cognitive 27) · ×1
  • IndexTableUtil.checkAndAddIndexTable (cognitive 27) integration/spark/src/main/java/org/apache/spark/sql/index/IndexTableUtil.java:38 — IndexTableUtil.checkAndAddIndexTable has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (7 pts) (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.
D2 · Cognitive Complexity · LuceneFineGrainIndex.prune (cognitive 27) · ×1
  • LuceneFineGrainIndex.prune (cognitive 27) index/lucene/src/main/java/org/apache/carbondata/index/lucene/LuceneFineGrainIndex.java:204 — LuceneFineGrainIndex.prune has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 5 (10 pts), error handling 3 (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.
D2 · Cognitive Complexity · LuceneIndexWriter.addField (cognitive 27) · ×1
  • LuceneIndexWriter.addField (cognitive 27) index/lucene/src/main/java/org/apache/carbondata/index/lucene/LuceneIndexWriter.java:244 — LuceneIndexWriter.addField has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 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.
D2 · Cognitive Complexity · BloomCoarseGrainIndex.createQueryModel (cognitive 27) · ×1
  • BloomCoarseGrainIndex.createQueryModel (cognitive 27) index/bloom/src/main/java/org/apache/carbondata/index/bloom/BloomCoarseGrainIndex.java:203 — BloomCoarseGrainIndex.createQueryModel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · CarbonTableInputFormat.getFilteredSegment (cognitive 27) · ×1
  • CarbonTableInputFormat.getFilteredSegment (cognitive 27) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java:224 — CarbonTableInputFormat.getFilteredSegment has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · RangeValueFilterExecutorImpl.isScanRequired (cognitive 27) · ×1
  • RangeValueFilterExecutorImpl.isScanRequired (cognitive 27) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:265 — RangeValueFilterExecutorImpl.isScanRequired has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 12 (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.
D2 · Cognitive Complexity · SegmentStatusManager.updateDeletionStatus (cognitive 27) · ×1
  • SegmentStatusManager.updateDeletionStatus (cognitive 27) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:565 — SegmentStatusManager.updateDeletionStatus has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (26 pts), error handling 1 (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.
D2 · Cognitive Complexity · BlockletIndexUtil.useMinMaxForBlockletPruning (cognitive 27) · ×1
  • BlockletIndexUtil.useMinMaxForBlockletPruning (cognitive 27) core/src/main/java/org/apache/carbondata/core/util/BlockletIndexUtil.java:413 — BlockletIndexUtil.useMinMaxForBlockletPruning has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (7 pts) (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.
D2 · Cognitive Complexity · CarbonInsertIntoHadoopFsRelationCommand.run (cognitive 27) · ×1
  • CarbonInsertIntoHadoopFsRelationCommand.run (cognitive 27) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoHadoopFsRelationCommand.scala:68 — CarbonInsertIntoHadoopFsRelationCommand.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · AlterTableColumnRenameEventListener.onEvent (cognitive 27) · ×1
  • AlterTableColumnRenameEventListener.onEvent (cognitive 27) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/AlterTableColumnRenameEventListener.scala:51 — AlterTableColumnRenameEventListener.onEvent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (3 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 15). 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.
D2 · Cognitive Complexity · HarmonizeFactTable.apply (cognitive 27) · ×1
  • HarmonizeFactTable.apply (cognitive 27) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/modular/Harmonizer.scala:115 — HarmonizeFactTable.apply has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 6 (15 pts), if/else 5 (8 pts), boolean chains 4 (nesting depth added 12). 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.
D2 · Cognitive Complexity · AvroCarbonWriter.prepareSubFields (cognitive 26) · ×1
  • AvroCarbonWriter.prepareSubFields (cognitive 26) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:645 — AvroCarbonWriter.prepareSubFields has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · CarbonHiveSerDe.inferSchema (cognitive 26) · ×1
  • CarbonHiveSerDe.inferSchema (cognitive 26) integration/hive/src/main/java/org/apache/carbondata/hive/CarbonHiveSerDe.java:118 — CarbonHiveSerDe.inferSchema has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (5 pts), error handling 1 (4 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.
D2 · Cognitive Complexity · StreamRecordReader.readRawRowFromStream (cognitive 26) · ×1
  • StreamRecordReader.readRawRowFromStream (cognitive 26) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:539 — StreamRecordReader.readRawRowFromStream has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (23 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.
D2 · Cognitive Complexity · ExcludeFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 26) · ×1
  • ExcludeFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 26) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:369 — ExcludeFilterExecutorImpl.setFilteredIndexToBitSet has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (9 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.
D2 · Cognitive Complexity · IncludeFilterExecutorImpl.prunePages (cognitive 26) · ×1
  • IncludeFilterExecutorImpl.prunePages (cognitive 26) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:197 — IncludeFilterExecutorImpl.prunePages has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), 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.
D2 · Cognitive Complexity · IncludeFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 26) · ×1
  • IncludeFilterExecutorImpl.setFilteredIndexToBitSet (cognitive 26) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:445 — IncludeFilterExecutorImpl.setFilteredIndexToBitSet has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (9 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.
D2 · Cognitive Complexity · FilterUtil.createFilterExecutorTree (cognitive 26) · ×1
  • FilterUtil.createFilterExecutorTree (cognitive 26) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:119 — FilterUtil.createFilterExecutorTree has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · CleanFilesUtil.cleanStaleSegments (cognitive 26) · ×1
  • CleanFilesUtil.cleanStaleSegments (cognitive 26) core/src/main/java/org/apache/carbondata/core/util/CleanFilesUtil.java:51 — CleanFilesUtil.cleanStaleSegments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (6 pts), error handling 1 (5 pts) (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.
D2 · Cognitive Complexity · MVHelper.addOrModifyMVTablesMap (cognitive 26) · ×1
  • MVHelper.addOrModifyMVTablesMap (cognitive 26) integration/spark/src/main/scala/org/apache/carbondata/view/MVHelper.scala:390 — MVHelper.addOrModifyMVTablesMap has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 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.
D2 · Cognitive Complexity · CommonLoadUtils.convertToLogicalRelation (cognitive 26) · ×1
  • CommonLoadUtils.convertToLogicalRelation (cognitive 26) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:648 — CommonLoadUtils.convertToLogicalRelation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (20 pts), match/switch 2 (6 pts) (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.
D2 · Cognitive Complexity · CarbonMergeDataSetCommand.processIUD (cognitive 26) · ×1
  • CarbonMergeDataSetCommand.processIUD (cognitive 26) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetCommand.scala:542 — CarbonMergeDataSetCommand.processIUD has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · SIDropEventListener.onEvent (cognitive 26) · ×1
  • SIDropEventListener.onEvent (cognitive 26) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/SIDropEventListener.scala:46 — SIDropEventListener.onEvent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), error handling 2 (5 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.
D2 · Cognitive Complexity · BroadCastSIFilterPushJoin.addInFilterToPlan (cognitive 26) · ×1
  • BroadCastSIFilterPushJoin.addInFilterToPlan (cognitive 26) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/joins/BroadCastSIFilterPushJoin.scala:150 — BroadCastSIFilterPushJoin.addInFilterToPlan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11, match/switch 7 (9 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CarbonSecondaryIndexOptimizer.createIndexFilterDataFrame (cognitive 26) · ×1
  • CarbonSecondaryIndexOptimizer.createIndexFilterDataFrame (cognitive 26) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala:251 — CarbonSecondaryIndexOptimizer.createIndexFilterDataFrame has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 4 (8 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.
D2 · Cognitive Complexity · reader.make_reader (cognitive 26) · ×1
  • reader.make_reader (cognitive 26) python/pycarbon/reader.py:24 — reader.make_reader has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (26 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.
D2 · Cognitive Complexity · StreamSegment.recoverSegmentIfRequired (cognitive 25) · ×1
  • StreamSegment.recoverSegmentIfRequired (cognitive 25) streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:305 — StreamSegment.recoverSegmentIfRequired has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (11 pts), boolean chains 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.
D2 · Cognitive Complexity · CarbonDataMergerUtil.updateStatusFile (cognitive 25) · ×1
  • CarbonDataMergerUtil.updateStatusFile (cognitive 25) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:1044 — CarbonDataMergerUtil.updateStatusFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (6 pts), error handling 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.
D2 · Cognitive Complexity · CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRowAsDataFieldOrder (cognitive 25) · ×1
  • CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRowAsDataFieldOrder (cognitive 25) processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:562 — CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRowAsDataFieldOrder has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 6, boolean chains 3 (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.
D2 · Cognitive Complexity · ColumnPage.newPage (cognitive 25) · ×1
  • ColumnPage.newPage (cognitive 25) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:177 — ColumnPage.newPage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (20 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.
D2 · Cognitive Complexity · SchemaGenerator.updateBytePosition (cognitive 25) · ×1
  • SchemaGenerator.updateBytePosition (cognitive 25) core/src/main/java/org/apache/carbondata/core/indexstore/schema/SchemaGenerator.java:89 — SchemaGenerator.updateBytePosition has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (8 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.
D2 · Cognitive Complexity · CarbonTable.getMinMaxCacheColumns (cognitive 25) · ×1
  • CarbonTable.getMinMaxCacheColumns (cognitive 25) core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:1033 — CarbonTable.getMinMaxCacheColumns has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (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.
D2 · Cognitive Complexity · DictionaryBasedResultCollector.collectResultInRow (cognitive 25) · ×1
  • DictionaryBasedResultCollector.collectResultInRow (cognitive 25) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedResultCollector.java:113 — DictionaryBasedResultCollector.collectResultInRow has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (7 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.
D2 · Cognitive Complexity · NotInExpression.evaluate (cognitive 25) · ×1
  • NotInExpression.evaluate (cognitive 25) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotInExpression.java:42 — NotInExpression.evaluate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (22 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.
D2 · Cognitive Complexity · UnsafeComparer.compareTo (cognitive 25) · ×1
  • UnsafeComparer.compareTo (cognitive 25) core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:136 — UnsafeComparer.compareTo has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 1 (4 pts), loops 2, 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.
D2 · Cognitive Complexity · CarbonMetadataUtil.getBlockletIndex (cognitive 25) · ×1
  • CarbonMetadataUtil.getBlockletIndex (cognitive 25) core/src/main/java/org/apache/carbondata/core/util/CarbonMetadataUtil.java:215 — CarbonMetadataUtil.getBlockletIndex has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 8 (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.
D2 · Cognitive Complexity · MVProvider.updateStatus (cognitive 25) · ×1
  • MVProvider.updateStatus (cognitive 25) core/src/main/java/org/apache/carbondata/core/view/MVProvider.java:244 — MVProvider.updateStatus has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 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.
D2 · Cognitive Complexity · DataTrashManager.dryRunOnExpiredSegments (cognitive 25) · ×1
  • DataTrashManager.dryRunOnExpiredSegments (cognitive 25) integration/spark/src/main/scala/org/apache/carbondata/trash/DataTrashManager.scala:268 — DataTrashManager.dryRunOnExpiredSegments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 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.
D2 · Cognitive Complexity · DataLoadPartitionCoalescer.assignPartitionNoLocality (cognitive 25) · ×1
  • DataLoadPartitionCoalescer.assignPartitionNoLocality (cognitive 25) integration/spark/src/main/scala/org/apache/spark/rdd/DataLoadPartitionCoalescer.scala:220 — DataLoadPartitionCoalescer.assignPartitionNoLocality has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (7 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.
D2 · Cognitive Complexity · CarbonBuilder.getOrCreateCarbonSession (cognitive 25) · ×1
  • CarbonBuilder.getOrCreateCarbonSession (cognitive 25) integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala:175 — CarbonBuilder.getOrCreateCarbonSession has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 3, match/switch 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.
D2 · Cognitive Complexity · CarbonMergeDataSetUtil.getTargetTableKeyColumns (cognitive 25) · ×1
  • CarbonMergeDataSetUtil.getTargetTableKeyColumns (cognitive 25) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetUtil.scala:337 — CarbonMergeDataSetUtil.getTargetTableKeyColumns has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (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.
D2 · Cognitive Complexity · CarbonAlterTableDropColumnCommand.processMetadata (cognitive 25) · ×1
  • CarbonAlterTableDropColumnCommand.processMetadata (cognitive 25) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableDropColumnCommand.scala:43 — CarbonAlterTableDropColumnCommand.processMetadata has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · CarbonIUDAnalysisRule.processUpdateQuery (cognitive 25) · ×1
  • CarbonIUDAnalysisRule.processUpdateQuery (cognitive 25) REDACTED:52 — CarbonIUDAnalysisRule.processUpdateQuery has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 6 (10 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · AlterTableUtil.validateComplexStructure (cognitive 25) · ×1
  • AlterTableUtil.validateComplexStructure (cognitive 25) integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala:1109 — AlterTableUtil.validateComplexStructure has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · CarbonReaderBuilder.totalRowCountInSplits (cognitive 24) · ×1
  • CarbonReaderBuilder.totalRowCountInSplits (cognitive 24) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReaderBuilder.java:439 — CarbonReaderBuilder.totalRowCountInSplits has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (7 pts), error handling 1 (4 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.
D2 · Cognitive Complexity · SortState.gallopLeft (cognitive 24) · ×1
  • SortState.gallopLeft (cognitive 24) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:548 — SortState.gallopLeft has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), boolean chains 4 (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. This shape REPEATS in the file: one other method here (SortState.gallopRight) 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.
D2 · Cognitive Complexity · SortState.gallopRight (cognitive 24) · ×1
  • SortState.gallopRight (cognitive 24) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/sort/TimSort.java:625 — SortState.gallopRight has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), boolean chains 4 (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. This shape REPEATS in the file: one other method here (SortState.gallopLeft) 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.
D2 · Cognitive Complexity · CarbonTableInputFormat.getSplitsOfStreaming (cognitive 24) · ×1
  • CarbonTableInputFormat.getSplitsOfStreaming (cognitive 24) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java:277 — CarbonTableInputFormat.getSplitsOfStreaming has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · StreamRecordReader.initialize (cognitive 24) · ×1
  • StreamRecordReader.initialize (cognitive 24) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamRecordReader.java:126 — StreamRecordReader.initialize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 6 (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.
D2 · Cognitive Complexity · 1.decodeAndFillVector (cognitive 24) · ×1
  • 1.decodeAndFillVector (cognitive 24) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:249 — 1.decodeAndFillVector has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 2 (5 pts), ternaries 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.
D2 · Cognitive Complexity · ColumnPage.decompress (cognitive 24) · ×1
  • ColumnPage.decompress (cognitive 24) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:788 — ColumnPage.decompress has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 7 (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.
D2 · Cognitive Complexity · IndexChooser.selectIndex (cognitive 24) · ×1
  • IndexChooser.selectIndex (cognitive 24) core/src/main/java/org/apache/carbondata/core/index/IndexChooser.java:156 — IndexChooser.selectIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, match/switch 1 (nesting depth added 10). 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.
D2 · Cognitive Complexity · BlockletIndexFactory.getTableBlockIndexUniqueIdentifierUsingSegmentMinMax (cognitive 24) · ×1
  • BlockletIndexFactory.getTableBlockIndexUniqueIdentifierUsingSegmentMinMax (cognitive 24) core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndexFactory.java:229 — BlockletIndexFactory.getTableBlockIndexUniqueIdentifierUsingSegmentMinMax has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). 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.
D2 · Cognitive Complexity · UnsafeMemoryDMStore.addIndexRow (cognitive 24) · ×1
  • UnsafeMemoryDMStore.addIndexRow (cognitive 24) core/src/main/java/org/apache/carbondata/core/indexstore/UnsafeMemoryDMStore.java:119 — UnsafeMemoryDMStore.addIndexRow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (8 pts), match/switch 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.
D2 · Cognitive Complexity · CarbonTable.fillDimensionsAndMeasuresForTables (cognitive 24) · ×1
  • CarbonTable.fillDimensionsAndMeasuresForTables (cognitive 24) core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java:321 — CarbonTable.fillDimensionsAndMeasuresForTables has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 2, loops 1 (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.
D2 · Cognitive Complexity · SegmentFile.merge (cognitive 24) · ×1
  • SegmentFile.merge (cognitive 24) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:1463 — SegmentFile.merge has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (6 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · ExpressionResult.getInt (cognitive 24) · ×1
  • ExpressionResult.getInt (cognitive 24) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:68 — ExpressionResult.getInt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), error handling 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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanFilterExecutorImpl.ifDefaultValueMatchesFilter (cognitive 24) · ×1
  • RowLevelRangeGreaterThanFilterExecutorImpl.ifDefaultValueMatchesFilter (cognitive 24) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:82 — RowLevelRangeGreaterThanFilterExecutorImpl.ifDefaultValueMatchesFilter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · ConditionalFilterResolverImpl.resolve (cognitive 24) · ×1
  • ConditionalFilterResolverImpl.resolve (cognitive 24) core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/ConditionalFilterResolverImpl.java:67 — ConditionalFilterResolverImpl.resolve has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 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.
D2 · Cognitive Complexity · TableNewProcessor.process (cognitive 24) · ×1
  • TableNewProcessor.process (cognitive 24) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala:706 — TableNewProcessor.process has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
D2 · Cognitive Complexity · CarbonProjectForDeleteCommand.processData (cognitive 24) · ×1
  • CarbonProjectForDeleteCommand.processData (cognitive 24) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForDeleteCommand.scala:55 — CarbonProjectForDeleteCommand.processData has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19 (22 pts), 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, 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.
D2 · Cognitive Complexity · CarbonFilters.translateUDF (cognitive 24) · ×1
  • CarbonFilters.translateUDF (cognitive 24) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonFilters.scala:224 — CarbonFilters.translateUDF has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · CarbonIUD.ifRowsDeleted (cognitive 23) · ×1
  • CarbonIUD.ifRowsDeleted (cognitive 23) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonIUD.java:385 — CarbonIUD.ifRowsDeleted has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (9 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.
D2 · Cognitive Complexity · CarbonReader.readNextBatchRow (cognitive 23) · ×1
  • CarbonReader.readNextBatchRow (cognitive 23) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java:224 — CarbonReader.readNextBatchRow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (10 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.
D2 · Cognitive Complexity · CarbonSchemaReader.readSchema (cognitive 23) · ×1
  • CarbonSchemaReader.readSchema (cognitive 23) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonSchemaReader.java:164 — CarbonSchemaReader.readSchema has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (6 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.
D2 · Cognitive Complexity · LoadOption.getCsvHeaderColumns (cognitive 23) · ×1
  • LoadOption.getCsvHeaderColumns (cognitive 23) processing/src/main/java/org/apache/carbondata/processing/loading/model/LoadOption.java:193 — LoadOption.getCsvHeaderColumns has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (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.
D2 · Cognitive Complexity · CarbonCompactionUtil.getSortColumnsOfSegment (cognitive 23) · ×1
  • CarbonCompactionUtil.getSortColumnsOfSegment (cognitive 23) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonCompactionUtil.java:630 — CarbonCompactionUtil.getSortColumnsOfSegment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). 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.
D2 · Cognitive Complexity · CarbonDataMergerUtil.updateLoadMetadataWithMergeStatus (cognitive 23) · ×1
  • CarbonDataMergerUtil.updateLoadMetadataWithMergeStatus (cognitive 23) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:158 — CarbonDataMergerUtil.updateLoadMetadataWithMergeStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 1 (2 pts), loops 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.
D2 · Cognitive Complexity · HiveDataTypeUtils.convertCarbonDataTypeToHive (cognitive 23) · ×1
  • HiveDataTypeUtils.convertCarbonDataTypeToHive (cognitive 23) integration/hive/src/main/java/org/apache/carbondata/hive/HiveDataTypeUtils.java:37 — HiveDataTypeUtils.convertCarbonDataTypeToHive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (21 pts), loops 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.
D2 · Cognitive Complexity · Field.<init> (cognitive 23) · ×1
  • Field.<init> (cognitive 23) core/src/main/java/org/apache/carbondata/core/metadata/datatype/Field.java:52 — Field.<init> has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (20 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · CarbonUpdateUtil.updateSegmentStatus (cognitive 23) · ×1
  • CarbonUpdateUtil.updateSegmentStatus (cognitive 23) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:149 — CarbonUpdateUtil.updateSegmentStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (8 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · FilterUtil.removeNullValues (cognitive 23) · ×1
  • FilterUtil.removeNullValues (cognitive 23) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:935 — FilterUtil.removeNullValues has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (7 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.
D2 · Cognitive Complexity · MVHelper.getFieldsMapFromProject (cognitive 23) · ×1
  • MVHelper.getFieldsMapFromProject (cognitive 23) integration/spark/src/main/scala/org/apache/carbondata/view/MVHelper.scala:194 — MVHelper.getFieldsMapFromProject has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 3 (5 pts) (nesting depth added 13). 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.
D2 · Cognitive Complexity · CarbonAlterTableCompactionCommand.alterTableForCompaction (cognitive 23) · ×1
  • CarbonAlterTableCompactionCommand.alterTableForCompaction (cognitive 23) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala:209 — CarbonAlterTableCompactionCommand.alterTableForCompaction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2, error handling 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · DDLStrategy.apply (cognitive 23) · ×1
  • DDLStrategy.apply (cognitive 23) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/DDLStrategy.scala:57 — DDLStrategy.apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 8). 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.
D2 · Cognitive Complexity · CarbonSetCommand.validateAndSetValue (cognitive 23) · ×1
  • CarbonSetCommand.validateAndSetValue (cognitive 23) integration/spark/src/main/scala/org/apache/spark/sql/hive/execution/command/CarbonHiveCommands.scala:111 — CarbonSetCommand.validateAndSetValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 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.
D2 · Cognitive Complexity · CarbonSpark2SqlParser.splitQuery (cognitive 23) · ×1
  • CarbonSpark2SqlParser.splitQuery (cognitive 23) integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala:431 — CarbonSpark2SqlParser.splitQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 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.
D2 · Cognitive Complexity · DataSummary.run (cognitive 22) · ×1
  • DataSummary.run (cognitive 22) tools/cli/src/main/java/org/apache/carbondata/tool/DataSummary.java:70 — DataSummary.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · CarbonWriterBuilder.withTableProperties (cognitive 22) · ×1
  • CarbonWriterBuilder.withTableProperties (cognitive 22) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:335 — CarbonWriterBuilder.withTableProperties has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 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.
D2 · Cognitive Complexity · MapParserImpl.parse (cognitive 22) · ×1
  • MapParserImpl.parse (cognitive 22) processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/MapParserImpl.java:41 — MapParserImpl.parse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (8 pts), ternaries 1 (5 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · CarbonInternalLoaderUtil.updateLoadMetadataWithMergeStatus (cognitive 22) · ×1
  • CarbonInternalLoaderUtil.updateLoadMetadataWithMergeStatus (cognitive 22) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:261 — CarbonInternalLoaderUtil.updateLoadMetadataWithMergeStatus has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 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.
D2 · Cognitive Complexity · AdaptiveCodec.getPageBasedOnDataType (cognitive 22) · ×1
  • AdaptiveCodec.getPageBasedOnDataType (cognitive 22) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java:83 — AdaptiveCodec.getPageBasedOnDataType has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 7, 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. This shape REPEATS in the file: one other method here (AdaptiveCodec.putDataToPage) 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.
D2 · Cognitive Complexity · AdaptiveCodec.putDataToPage (cognitive 22) · ×1
  • AdaptiveCodec.putDataToPage (cognitive 22) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java:123 — AdaptiveCodec.putDataToPage has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 7, 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. This shape REPEATS in the file: one other method here (AdaptiveCodec.getPageBasedOnDataType) 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.
D2 · Cognitive Complexity · TableIndex.pruneMultiThread (cognitive 22) · ×1
  • TableIndex.pruneMultiThread (cognitive 22) core/src/main/java/org/apache/carbondata/core/index/TableIndex.java:277 — TableIndex.pruneMultiThread has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (6 pts), error handling 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.
D2 · Cognitive Complexity · BlockletIndexStore.get (cognitive 22) · ×1
  • BlockletIndexStore.get (cognitive 22) core/src/main/java/org/apache/carbondata/core/indexstore/BlockletIndexStore.java:73 — BlockletIndexStore.get has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (6 pts), error handling 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.
D2 · Cognitive Complexity · SegmentFileStore.deletePhysicalPartition (cognitive 22) · ×1
  • SegmentFileStore.deletePhysicalPartition (cognitive 22) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:1244 — SegmentFileStore.deletePhysicalPartition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 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.
D2 · Cognitive Complexity · InExpression.evaluate (cognitive 22) · ×1
  • InExpression.evaluate (cognitive 22) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:42 — InExpression.evaluate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 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.
D2 · Cognitive Complexity · ExpressionResult.getDecimal (cognitive 22) · ×1
  • ExpressionResult.getDecimal (cognitive 22) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:275 — ExpressionResult.getDecimal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · ExpressionResult.getShort (cognitive 22) · ×1
  • ExpressionResult.getShort (cognitive 22) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:118 — ExpressionResult.getShort has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 2 (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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanEqualFilterExecutorImpl.ifDefaultValueMatchesFilter (cognitive 22) · ×1
  • RowLevelRangeGreaterThanEqualFilterExecutorImpl.ifDefaultValueMatchesFilter (cognitive 22) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:82 — RowLevelRangeGreaterThanEqualFilterExecutorImpl.ifDefaultValueMatchesFilter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanEqualFilterExecutorImpl.ifDefaultValueMatchesFilter (cognitive 22) · ×1
  • RowLevelRangeLessThanEqualFilterExecutorImpl.ifDefaultValueMatchesFilter (cognitive 22) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:81 — RowLevelRangeLessThanEqualFilterExecutorImpl.ifDefaultValueMatchesFilter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanFilterExecutorImpl.ifDefaultValueMatchesFilter (cognitive 22) · ×1
  • RowLevelRangeLessThanFilterExecutorImpl.ifDefaultValueMatchesFilter (cognitive 22) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:81 — RowLevelRangeLessThanFilterExecutorImpl.ifDefaultValueMatchesFilter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex (cognitive 22) · ×1
  • RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex (cognitive 22) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:456 — RowLevelRangeLessThanFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (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.
D2 · Cognitive Complexity · QueryModel.processFilterExpression (cognitive 22) · ×1
  • QueryModel.processFilterExpression (cognitive 22) core/src/main/java/org/apache/carbondata/core/scan/model/QueryModel.java:131 — QueryModel.processFilterExpression has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (10 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.
D2 · Cognitive Complexity · SegmentUpdateStatusManager.getDeleteDeltaFilesList (cognitive 22) · ×1
  • SegmentUpdateStatusManager.getDeleteDeltaFilesList (cognitive 22) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:370 — SegmentUpdateStatusManager.getDeleteDeltaFilesList has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 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.
D2 · Cognitive Complexity · CarbonSparkDataSourceUtil.createCarbonFilter (cognitive 22) · ×1
  • CarbonSparkDataSourceUtil.createCarbonFilter (cognitive 22) integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/CarbonSparkDataSourceUtil.scala:115 — CarbonSparkDataSourceUtil.createCarbonFilter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (5 pts), boolean chains 4, match/switch 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.
D2 · Cognitive Complexity · CastExpressionOptimization.checkIfCastCanBeRemove (cognitive 22) · ×1
  • CastExpressionOptimization.checkIfCastCanBeRemove (cognitive 22) integration/spark/src/main/scala/org/apache/spark/sql/execution/CastExpressionOptimization.scala:158 — CastExpressionOptimization.checkIfCastCanBeRemove has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 3, 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.
D2 · Cognitive Complexity · ShowIndexesCommand.getIndexInfo (cognitive 22) · ×1
  • ShowIndexesCommand.getIndexInfo (cognitive 22) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/ShowIndexesCommand.scala:68 — ShowIndexesCommand.getIndexInfo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (7 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.
D2 · Cognitive Complexity · CarbonDropTableCommand.processMetadata (cognitive 22) · ×1
  • CarbonDropTableCommand.processMetadata (cognitive 22) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala:54 — CarbonDropTableCommand.processMetadata has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 4, boolean chains 1, match/switch 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.
D2 · Cognitive Complexity · MVMatchPattern.factorOutSubsumer (cognitive 22) · ×1
  • MVMatchPattern.factorOutSubsumer (cognitive 22) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala:78 — MVMatchPattern.factorOutSubsumer has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 8). 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.
D2 · Cognitive Complexity · AlterTableUtil.validateSortScopeAndSortColumnsProperties (cognitive 22) · ×1
  • AlterTableUtil.validateSortScopeAndSortColumnsProperties (cognitive 22) integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala:695 — AlterTableUtil.validateSortScopeAndSortColumnsProperties has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (22 pts) (nesting depth added 12). 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.
D2 · Cognitive Complexity · SQLFragmentCompactPrinter.printExprModifiers (cognitive 22) · ×1
  • SQLFragmentCompactPrinter.printExprModifiers (cognitive 22) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Printers.scala:190 — SQLFragmentCompactPrinter.printExprModifiers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (9 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.
D2 · Cognitive Complexity · CarbonReaderBuilder.prepareFileInputFormat (cognitive 21) · ×1
  • CarbonReaderBuilder.prepareFileInputFormat (cognitive 21) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReaderBuilder.java:292 — CarbonReaderBuilder.prepareFileInputFormat has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (4 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSize (cognitive 21) · ×1
  • CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSize (cognitive 21) processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:518 — CarbonDataMergerUtil.identifySegmentsToBeMergedBasedOnSize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 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.
D2 · Cognitive Complexity · HiveCarbonUtil.splitSchemaStringToArray (cognitive 21) · ×1
  • HiveCarbonUtil.splitSchemaStringToArray (cognitive 21) integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java:322 — HiveCarbonUtil.splitSchemaStringToArray has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 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.
D2 · Cognitive Complexity · Hive2CarbonExpression.convertExprHive2Carbon (cognitive 21) · ×1
  • Hive2CarbonExpression.convertExprHive2Carbon (cognitive 21) integration/hive/src/main/java/org/apache/carbondata/hive/Hive2CarbonExpression.java:77 — Hive2CarbonExpression.convertExprHive2Carbon has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 1 (3 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.
D2 · Cognitive Complexity · SegmentFileStore.getSegmentFileForPhysicalDataPartitions (cognitive 21) · ×1
  • SegmentFileStore.getSegmentFileForPhysicalDataPartitions (cognitive 21) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:738 — SegmentFileStore.getSegmentFileForPhysicalDataPartitions 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.
D2 · Cognitive Complexity · ExpressionResult.getDouble (cognitive 21) · ×1
  • ExpressionResult.getDouble (cognitive 21) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:185 — ExpressionResult.getDouble has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · ExpressionResult.getTime (cognitive 21) · ×1
  • ExpressionResult.getTime (cognitive 21) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:321 — ExpressionResult.getTime has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · SegmentUpdateStatusManager.getDeleteDeltaInvalidFilesList (cognitive 21) · ×1
  • SegmentUpdateStatusManager.getDeleteDeltaInvalidFilesList (cognitive 21) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:614 — SegmentUpdateStatusManager.getDeleteDeltaInvalidFilesList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 2, loops 1 (nesting depth added 12). 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.
D2 · Cognitive Complexity · CarbonUtil.reorderColumnsForLongString (cognitive 21) · ×1
  • CarbonUtil.reorderColumnsForLongString (cognitive 21) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:3385 — CarbonUtil.reorderColumnsForLongString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 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.
D2 · Cognitive Complexity · TrashUtil.deleteExpiredDataFromTrash (cognitive 21) · ×1
  • TrashUtil.deleteExpiredDataFromTrash (cognitive 21) core/src/main/java/org/apache/carbondata/core/util/TrashUtil.java:157 — TrashUtil.deleteExpiredDataFromTrash has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (5 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · IndexRebuildRDD.internalCompute (cognitive 21) · ×1
  • IndexRebuildRDD.internalCompute (cognitive 21) integration/spark/src/main/scala/org/apache/carbondata/index/IndexRebuildRDD.scala:270 — IndexRebuildRDD.internalCompute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (6 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.
D2 · Cognitive Complexity · CarbonParserUtil.processSpatialIndexProperty (cognitive 21) · ×1
  • CarbonParserUtil.processSpatialIndexProperty (cognitive 21) integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala:117 — CarbonParserUtil.processSpatialIndexProperty has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · CarbonAlterTableRenameCommand.processMetadata (cognitive 21) · ×1
  • CarbonAlterTableRenameCommand.processMetadata (cognitive 21) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala:46 — CarbonAlterTableRenameCommand.processMetadata has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, 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, 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.
D2 · Cognitive Complexity · CarbonShowCreateTableCommand.processMetadata (cognitive 21) · ×1
  • CarbonShowCreateTableCommand.processMetadata (cognitive 21) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonShowCreateTableCommand.scala:38 — CarbonShowCreateTableCommand.processMetadata has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 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.
D2 · Cognitive Complexity · MVRewrite.rewriteWithSchemaWrapper0 (cognitive 21) · ×1
  • MVRewrite.rewriteWithSchemaWrapper0 (cognitive 21) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:403 — MVRewrite.rewriteWithSchemaWrapper0 has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (14 pts), if/else 5 (6 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · BoundedInputStream.read (cognitive 20) · ×1
  • BoundedInputStream.read (cognitive 20) processing/src/main/java/org/apache/carbondata/processing/loading/csvinput/BoundedInputStream.java:90 — BoundedInputStream.read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · InputProcessorIterator.getBatch (cognitive 20) · ×1
  • InputProcessorIterator.getBatch (cognitive 20) processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:327 — InputProcessorIterator.getBatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 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.
D2 · Cognitive Complexity · CarbonTableInputFormat.getSplits (cognitive 20) · ×1
  • CarbonTableInputFormat.getSplits (cognitive 20) hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java:112 — CarbonTableInputFormat.getSplits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 1 (2 pts), 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.
D2 · Cognitive Complexity · StreamBlockletReader.sync (cognitive 20) · ×1
  • StreamBlockletReader.sync (cognitive 20) hadoop/src/main/java/org/apache/carbondata/hadoop/stream/StreamBlockletReader.java:70 — StreamBlockletReader.sync has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 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.
D2 · Cognitive Complexity · CarbonVectorizedRecordReader.getCurrentValue (cognitive 20) · ×1
  • CarbonVectorizedRecordReader.getCurrentValue (cognitive 20) hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.java:209 — CarbonVectorizedRecordReader.getCurrentValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 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.
D2 · Cognitive Complexity · IndexStoreManager.deleteIndex (cognitive 20) · ×1
  • IndexStoreManager.deleteIndex (cognitive 20) core/src/main/java/org/apache/carbondata/core/index/IndexStoreManager.java:410 — IndexStoreManager.deleteIndex has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (7 pts), loops 1 (3 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.
D2 · Cognitive Complexity · DataTypes.valueOf (cognitive 20) · ×1
  • DataTypes.valueOf (cognitive 20) core/src/main/java/org/apache/carbondata/core/metadata/datatype/DataTypes.java:75 — DataTypes.valueOf has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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.
D2 · Cognitive Complexity · DictionaryBasedResultCollector.fillComplexColumnDataBufferForThisRow (cognitive 20) · ×1
  • DictionaryBasedResultCollector.fillComplexColumnDataBufferForThisRow (cognitive 20) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedResultCollector.java:197 — DictionaryBasedResultCollector.fillComplexColumnDataBufferForThisRow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 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.
D2 · Cognitive Complexity · RestructureBasedDictionaryResultCollector.collectResultInRow (cognitive 20) · ×1
  • RestructureBasedDictionaryResultCollector.collectResultInRow (cognitive 20) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedDictionaryResultCollector.java:67 — RestructureBasedDictionaryResultCollector.collectResultInRow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 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.
D2 · Cognitive Complexity · RestructureBasedRawResultCollector.fillDictionaryKeyArrayBatchWithLatestSchema (cognitive 20) · ×1
  • RestructureBasedRawResultCollector.fillDictionaryKeyArrayBatchWithLatestSchema (cognitive 20) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedRawResultCollector.java:89 — RestructureBasedRawResultCollector.fillDictionaryKeyArrayBatchWithLatestSchema has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 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.
D2 · Cognitive Complexity · AbstractQueryExecutor.getBlockExecutionInfoForBlock (cognitive 20) · ×1
  • AbstractQueryExecutor.getBlockExecutionInfoForBlock (cognitive 20) core/src/main/java/org/apache/carbondata/core/scan/executor/impl/AbstractQueryExecutor.java:435 — AbstractQueryExecutor.getBlockExecutionInfoForBlock has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 2 (4 pts), loops 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.
D2 · Cognitive Complexity · RowLevelFilterExecutorImpl.convertRow (cognitive 20) · ×1
  • RowLevelFilterExecutorImpl.convertRow (cognitive 20) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:382 — RowLevelFilterExecutorImpl.convertRow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanEqualFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex (cognitive 20) · ×1
  • RowLevelRangeLessThanEqualFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex (cognitive 20) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:461 — RowLevelRangeLessThanEqualFilterExecutorImpl.setFilteredIndexToBitSetWithColumnIndex has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 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.
D2 · Cognitive Complexity · BlockletFilterScanner.executeFilter (cognitive 20) · ×1
  • BlockletFilterScanner.executeFilter (cognitive 20) core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java:172 — BlockletFilterScanner.executeFilter has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (10 pts), if/else 5 (9 pts), boolean chains 1 (nesting depth added 6). 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.
D2 · Cognitive Complexity · CarbonUtil.compareMeasureData (cognitive 20) · ×1
  • CarbonUtil.compareMeasureData (cognitive 20) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1028 — CarbonUtil.compareMeasureData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 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.
D2 · Cognitive Complexity · DataTypeUtil.valueOf (cognitive 20) · ×1
  • DataTypeUtil.valueOf (cognitive 20) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:1096 — DataTypeUtil.valueOf has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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.
D2 · Cognitive Complexity · ExtendedRollingFileAppender.rollOver (cognitive 20) · ×1
  • ExtendedRollingFileAppender.rollOver (cognitive 20) common/src/main/java/org/apache/carbondata/common/logging/impl/ExtendedRollingFileAppender.java:112 — ExtendedRollingFileAppender.rollOver has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 8 (10 pts) (nesting depth added 8). 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.
D2 · Cognitive Complexity · CarbonStore.getDataAndIndexSize (cognitive 20) · ×1
  • CarbonStore.getDataAndIndexSize (cognitive 20) integration/spark/src/main/scala/org/apache/carbondata/api/CarbonStore.scala:258 — CarbonStore.getDataAndIndexSize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (20 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.
D2 · Cognitive Complexity · CarbonTableCompactor.executeCompaction (cognitive 20) · ×1
  • CarbonTableCompactor.executeCompaction (cognitive 20) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonTableCompactor.scala:88 — CarbonTableCompactor.executeCompaction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 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.
D2 · Cognitive Complexity · CarbonScalaUtil.convertToDateAndTimeFormats (cognitive 20) · ×1
  • CarbonScalaUtil.convertToDateAndTimeFormats (cognitive 20) integration/spark/src/main/scala/org/apache/carbondata/spark/util/CarbonScalaUtil.scala:102 — CarbonScalaUtil.convertToDateAndTimeFormats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (5 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · CarbonScalaUtil.convertStaticPartitionToValues (cognitive 20) · ×1
  • CarbonScalaUtil.convertStaticPartitionToValues (cognitive 20) integration/spark/src/main/scala/org/apache/carbondata/spark/util/CarbonScalaUtil.scala:155 — CarbonScalaUtil.convertStaticPartitionToValues has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (5 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · CarbonAlterTableAddHivePartitionCommand.processData (cognitive 20) · ×1
  • CarbonAlterTableAddHivePartitionCommand.processData (cognitive 20) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/partition/CarbonAlterTableAddHivePartitionCommand.scala:109 — CarbonAlterTableAddHivePartitionCommand.processData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · CarbonRelation.sizeInBytes (cognitive 20) · ×1
  • CarbonRelation.sizeInBytes (cognitive 20) integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonRelation.scala:178 — CarbonRelation.sizeInBytes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · AlterTableUtil.ValidateSetTablePropertiesForLocalDict (cognitive 20) · ×1
  • AlterTableUtil.ValidateSetTablePropertiesForLocalDict (cognitive 20) integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala:990 — AlterTableUtil.ValidateSetTablePropertiesForLocalDict has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 2 (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.
D2 · Cognitive Complexity · RawRowComparator.compare (cognitive 19) · ×1
  • RawRowComparator.compare (cognitive 19) processing/src/main/java/org/apache/carbondata/processing/loading/partition/impl/RawRowComparator.java:46 — RawRowComparator.compare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
D2 · Cognitive Complexity · IntermediateSortTempRowComparator.compare (cognitive 19) · ×1
  • IntermediateSortTempRowComparator.compare (cognitive 19) processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/IntermediateSortTempRowComparator.java:52 — IntermediateSortTempRowComparator.compare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
D2 · Cognitive Complexity · NewRowComparator.compare (cognitive 19) · ×1
  • NewRowComparator.compare (cognitive 19) processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/NewRowComparator.java:45 — NewRowComparator.compare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
D2 · Cognitive Complexity · CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRow (cognitive 19) · ×1
  • CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRow (cognitive 19) processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java:494 — CarbonDataProcessorUtil.getColumnIdxBasedOnSchemaInRow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 6, 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.
D2 · Cognitive Complexity · RowComparator.compare (cognitive 19) · ×1
  • RowComparator.compare (cognitive 19) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/RowComparator.java:48 — RowComparator.compare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
D2 · Cognitive Complexity · WritableReadSupport.createWritablePrimitive (cognitive 19) · ×1
  • WritableReadSupport.createWritablePrimitive (cognitive 19) integration/hive/src/main/java/org/apache/carbondata/hive/WritableReadSupport.java:209 — WritableReadSupport.createWritablePrimitive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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.
D2 · Cognitive Complexity · CarbonWriter.uploadSegmentDataFiles (cognitive 19) · ×1
  • CarbonWriter.uploadSegmentDataFiles (cognitive 19) integration/flink/src/main/java/org/apache/carbon/flink/CarbonWriter.java:78 — CarbonWriter.uploadSegmentDataFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (3 pts), loops 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.
D2 · Cognitive Complexity · SegmentProperties.fillDimensionAndMeasureDetails (cognitive 19) · ×1
  • SegmentProperties.fillDimensionAndMeasureDetails (cognitive 19) core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentProperties.java:295 — SegmentProperties.fillDimensionAndMeasureDetails has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · AdaptiveCodec.writeInvertedIndexIfRequired (cognitive 19) · ×1
  • AdaptiveCodec.writeInvertedIndexIfRequired (cognitive 19) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java:161 — AdaptiveCodec.writeInvertedIndexIfRequired has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 5 (9 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.
D2 · Cognitive Complexity · PrimitivePageStatsCollector.updateNull (cognitive 19) · ×1
  • PrimitivePageStatsCollector.updateNull (cognitive 19) core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java:165 — PrimitivePageStatsCollector.updateNull has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (6 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.
D2 · Cognitive Complexity · SafeFixLengthColumnPage.convertValue (cognitive 19) · ×1
  • SafeFixLengthColumnPage.convertValue (cognitive 19) core/src/main/java/org/apache/carbondata/core/datastore/page/SafeFixLengthColumnPage.java:395 — SafeFixLengthColumnPage.convertValue has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 7 (nesting depth added 6). 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.
D2 · Cognitive Complexity · UnsafeFixLengthColumnPage.convertValue (cognitive 19) · ×1
  • UnsafeFixLengthColumnPage.convertValue (cognitive 19) core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeFixLengthColumnPage.java:455 — UnsafeFixLengthColumnPage.convertValue has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 7 (nesting depth added 6). 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.
D2 · Cognitive Complexity · CarbonCostBasedOptimizer.identifyBestFitTable (cognitive 19) · ×1
  • CarbonCostBasedOptimizer.identifyBestFitTable (cognitive 19) core/src/main/java/org/apache/carbondata/core/index/secondaryindex/CarbonCostBasedOptimizer.java:102 — CarbonCostBasedOptimizer.identifyBestFitTable 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.
D2 · Cognitive Complexity · DictionaryBasedResultCollector.fillDimensionData (cognitive 19) · ×1
  • DictionaryBasedResultCollector.fillDimensionData (cognitive 19) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedResultCollector.java:258 — DictionaryBasedResultCollector.fillDimensionData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 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.
D2 · Cognitive Complexity · EqualToExpression.evaluate (cognitive 19) · ×1
  • EqualToExpression.evaluate (cognitive 19) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/EqualToExpression.java:44 — EqualToExpression.evaluate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 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.
D2 · Cognitive Complexity · NotEqualsExpression.evaluate (cognitive 19) · ×1
  • NotEqualsExpression.evaluate (cognitive 19) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotEqualsExpression.java:43 — NotEqualsExpression.evaluate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 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.
D2 · Cognitive Complexity · ExpressionResult.getTimeAsMillisecond (cognitive 19) · ×1
  • ExpressionResult.getTimeAsMillisecond (cognitive 19) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:374 — ExpressionResult.getTimeAsMillisecond has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · ExcludeFilterExecutorImpl.applyFilter (cognitive 19) · ×1
  • ExcludeFilterExecutorImpl.applyFilter (cognitive 19) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:165 — ExcludeFilterExecutorImpl.applyFilter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 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.
D2 · Cognitive Complexity · IncludeFilterExecutorImpl.applyFilter (cognitive 19) · ×1
  • IncludeFilterExecutorImpl.applyFilter (cognitive 19) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:249 — IncludeFilterExecutorImpl.applyFilter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 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.
D2 · Cognitive Complexity · ColumnarVectorWrapperDirectFactory.getDirectVectorWrapperFactory (cognitive 19) · ×1
  • ColumnarVectorWrapperDirectFactory.getDirectVectorWrapperFactory (cognitive 19) core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectFactory.java:43 — ColumnarVectorWrapperDirectFactory.getDirectVectorWrapperFactory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 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.
D2 · Cognitive Complexity · CarbonColumnVectorImpl.getData (cognitive 19) · ×1
  • CarbonColumnVectorImpl.getData (cognitive 19) core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java:301 — CarbonColumnVectorImpl.getData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · BlockletIndexUtil.getBlockMetaInfoMap (cognitive 19) · ×1
  • BlockletIndexUtil.getBlockMetaInfoMap (cognitive 19) core/src/main/java/org/apache/carbondata/core/util/BlockletIndexUtil.java:80 — BlockletIndexUtil.getBlockMetaInfoMap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · CarbonUtil.getFirstIndexUsingBinarySearch (cognitive 19) · ×1
  • CarbonUtil.getFirstIndexUsingBinarySearch (cognitive 19) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:380 — CarbonUtil.getFirstIndexUsingBinarySearch has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 5 (8 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · DataTypeUtil.convertDataToBytesBasedOnDataType (cognitive 19) · ×1
  • DataTypeUtil.convertDataToBytesBasedOnDataType (cognitive 19) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:993 — DataTypeUtil.convertDataToBytesBasedOnDataType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 2 (4 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.
D2 · Cognitive Complexity · DeleteLoadFolders.deleteLoadFoldersFromFileSystem (cognitive 19) · ×1
  • DeleteLoadFolders.deleteLoadFoldersFromFileSystem (cognitive 19) core/src/main/java/org/apache/carbondata/core/util/DeleteLoadFolders.java:246 — DeleteLoadFolders.deleteLoadFoldersFromFileSystem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (2 pts) (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.
D2 · Cognitive Complexity · MVManager.getCatalog (cognitive 19) · ×1
  • MVManager.getCatalog (cognitive 19) core/src/main/java/org/apache/carbondata/core/view/MVManager.java:183 — MVManager.getCatalog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (4 pts), loops 2, 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.
D2 · Cognitive Complexity · RawBytesReadSupport.readRow (cognitive 19) · ×1
  • RawBytesReadSupport.readRow (cognitive 19) integration/spark/src/main/scala/org/apache/carbondata/index/IndexRebuildRDD.scala:196 — RawBytesReadSupport.readRow 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.
D2 · Cognitive Complexity · CarbonScalaUtil.retrieveAndLogErrorMsg (cognitive 19) · ×1
  • CarbonScalaUtil.retrieveAndLogErrorMsg (cognitive 19) integration/spark/src/main/scala/org/apache/carbondata/spark/util/CarbonScalaUtil.scala:419 — CarbonScalaUtil.retrieveAndLogErrorMsg has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 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.
D2 · Cognitive Complexity · DataLoadPartitionCoalescer.assignPartitionNodeLocality (cognitive 19) · ×1
  • DataLoadPartitionCoalescer.assignPartitionNodeLocality (cognitive 19) integration/spark/src/main/scala/org/apache/spark/rdd/DataLoadPartitionCoalescer.scala:173 — DataLoadPartitionCoalescer.assignPartitionNodeLocality has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 2 (9 pts), if/else 4 (8 pts), loops 2 (nesting depth added 11). 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.
D2 · Cognitive Complexity · CarbonLoadDataCommand.processData (cognitive 19) · ×1
  • CarbonLoadDataCommand.processData (cognitive 19) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:93 — CarbonLoadDataCommand.processData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 3, 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.
D2 · Cognitive Complexity · CarbonMergeDataSetUtil.addFilePathAndMinMaxTuples (cognitive 19) · ×1
  • CarbonMergeDataSetUtil.addFilePathAndMinMaxTuples (cognitive 19) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetUtil.scala:76 — CarbonMergeDataSetUtil.addFilePathAndMinMaxTuples 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.
D2 · Cognitive Complexity · MixedFormatHandler.extraRDD (cognitive 19) · ×1
  • MixedFormatHandler.extraRDD (cognitive 19) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/MixedFormatHandler.scala:158 — MixedFormatHandler.extraRDD has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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.
D2 · Cognitive Complexity · MVLoadPostEventListener.onEvent (cognitive 19) · ×1
  • MVLoadPostEventListener.onEvent (cognitive 19) integration/spark/src/main/scala/org/apache/spark/sql/listeners/MVListeners.scala:108 — MVLoadPostEventListener.onEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · MVRewrite.rewriteWithSchemaWrapper0 (cognitive 19) · ×1
  • MVRewrite.rewriteWithSchemaWrapper0 (cognitive 19) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala:459 — MVRewrite.rewriteWithSchemaWrapper0 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (5 pts), 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.
D2 · Cognitive Complexity · carbon_pr.main (cognitive 19) · ×1
  • carbon_pr.main (cognitive 19) dev/carbon_pr.py:401 — carbon_pr.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · FileCollector.collectSortColumns (cognitive 18) · ×1
  • FileCollector.collectSortColumns (cognitive 18) tools/cli/src/main/java/org/apache/carbondata/tool/FileCollector.java:186 — FileCollector.collectSortColumns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
D2 · Cognitive Complexity · CarbonWriterBuilder.buildLoadModel (cognitive 18) · ×1
  • CarbonWriterBuilder.buildLoadModel (cognitive 18) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:931 — CarbonWriterBuilder.buildLoadModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ORCCarbonWriter.parseOrcObject (cognitive 18) · ×1
  • ORCCarbonWriter.parseOrcObject (cognitive 18) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.java:284 — ORCCarbonWriter.parseOrcObject has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (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.
D2 · Cognitive Complexity · DataLoadProcessBuilder.getDataFields (cognitive 18) · ×1
  • DataLoadProcessBuilder.getDataFields (cognitive 18) processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:284 — DataLoadProcessBuilder.getDataFields has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 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.
D2 · Cognitive Complexity · CarbonLoaderUtil.assignLeftOverBlocks (cognitive 18) · ×1
  • CarbonLoaderUtil.assignLeftOverBlocks (cognitive 18) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:711 — CarbonLoaderUtil.assignLeftOverBlocks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 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.
D2 · Cognitive Complexity · CarbonInternalLoaderUtil.isSegmentsAlreadyCompactedForNewMetaDataDetails (cognitive 18) · ×1
  • CarbonInternalLoaderUtil.isSegmentsAlreadyCompactedForNewMetaDataDetails (cognitive 18) integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:225 — CarbonInternalLoaderUtil.isSegmentsAlreadyCompactedForNewMetaDataDetails has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 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.
D2 · Cognitive Complexity · QuadNode.insert (cognitive 18) · ×1
  • QuadNode.insert (cognitive 18) geo/src/main/java/org/apache/carbondata/geo/QuadTreeCls.java:513 — QuadNode.insert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 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.
D2 · Cognitive Complexity · EncodingFactory.createDecoderLegacy (cognitive 18) · ×1
  • EncodingFactory.createDecoderLegacy (cognitive 18) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/EncodingFactory.java:156 — EncodingFactory.createDecoderLegacy 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.
D2 · Cognitive Complexity · ColumnPage.compress (cognitive 18) · ×1
  • ColumnPage.compress (cognitive 18) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:743 — ColumnPage.compress has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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.
D2 · Cognitive Complexity · BlockIndex.prune (cognitive 18) · ×1
  • BlockIndex.prune (cognitive 18) core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java:671 — BlockIndex.prune has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · ExtendedBlockletWrapperContainer.getExtendedBlocklets (cognitive 18) · ×1
  • ExtendedBlockletWrapperContainer.getExtendedBlocklets (cognitive 18) core/src/main/java/org/apache/carbondata/core/indexstore/ExtendedBlockletWrapperContainer.java:67 — ExtendedBlockletWrapperContainer.getExtendedBlocklets has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (8 pts), error handling 2 (5 pts), if/else 4 (5 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.
D2 · Cognitive Complexity · ThriftWrapperSchemaConverterImpl.fromWrapperToExternalDataType (cognitive 18) · ×1
  • ThriftWrapperSchemaConverterImpl.fromWrapperToExternalDataType (cognitive 18) core/src/main/java/org/apache/carbondata/core/metadata/converter/ThriftWrapperSchemaConverterImpl.java:134 — ThriftWrapperSchemaConverterImpl.fromWrapperToExternalDataType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
D2 · Cognitive Complexity · Encoding.valueOf (cognitive 18) · ×1
  • Encoding.valueOf (cognitive 18) core/src/main/java/org/apache/carbondata/core/metadata/encoder/Encoding.java:44 — Encoding.valueOf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
D2 · Cognitive Complexity · SegmentFileStore.dropPartitions (cognitive 18) · ×1
  • SegmentFileStore.dropPartitions (cognitive 18) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:1011 — SegmentFileStore.dropPartitions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 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.
D2 · Cognitive Complexity · BlockMinMaxTree.insert (cognitive 18) · ×1
  • BlockMinMaxTree.insert (cognitive 18) core/src/main/java/org/apache/carbondata/core/range/BlockMinMaxTree.java:59 — BlockMinMaxTree.insert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 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.
D2 · Cognitive Complexity · AbstractQueryExecutor.updateColumns (cognitive 18) · ×1
  • AbstractQueryExecutor.updateColumns (cognitive 18) core/src/main/java/org/apache/carbondata/core/scan/executor/impl/AbstractQueryExecutor.java:263 — AbstractQueryExecutor.updateColumns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 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.
D2 · Cognitive Complexity · QueryUtil.getComplexDimensionsMap (cognitive 18) · ×1
  • QueryUtil.getComplexDimensionsMap (cognitive 18) core/src/main/java/org/apache/carbondata/core/scan/executor/util/QueryUtil.java:244 — QueryUtil.getComplexDimensionsMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 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.
D2 · Cognitive Complexity · ExpressionResult.getLong (cognitive 18) · ×1
  • ExpressionResult.getLong (cognitive 18) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:231 — ExpressionResult.getLong has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · RowLevelRangeFilterResolverImpl.resolve (cognitive 18) · ×1
  • RowLevelRangeFilterResolverImpl.resolve (cognitive 18) core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java:186 — RowLevelRangeFilterResolverImpl.resolve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts) (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.
D2 · Cognitive Complexity · QueryModelBuilder.optimizeProjectionForComplexColumns (cognitive 18) · ×1
  • QueryModelBuilder.optimizeProjectionForComplexColumns (cognitive 18) core/src/main/java/org/apache/carbondata/core/scan/model/QueryModelBuilder.java:117 — QueryModelBuilder.optimizeProjectionForComplexColumns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 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.
D2 · Cognitive Complexity · QueryModelBuilder.projectColumns (cognitive 18) · ×1
  • QueryModelBuilder.projectColumns (cognitive 18) core/src/main/java/org/apache/carbondata/core/scan/model/QueryModelBuilder.java:56 — QueryModelBuilder.projectColumns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3, 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.
D2 · Cognitive Complexity · SegmentStatusManager.updateDeletionStatus (cognitive 18) · ×1
  • SegmentStatusManager.updateDeletionStatus (cognitive 18) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:746 — SegmentStatusManager.updateDeletionStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), 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.
D2 · Cognitive Complexity · DataTypeUtil.getBytesDataDataTypeForNoDictionaryColumn (cognitive 18) · ×1
  • DataTypeUtil.getBytesDataDataTypeForNoDictionaryColumn (cognitive 18) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:604 — DataTypeUtil.getBytesDataDataTypeForNoDictionaryColumn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (18 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.
D2 · Cognitive Complexity · StreamHandoffRDD.iterateStreamingHandoff (cognitive 18) · ×1
  • StreamHandoffRDD.iterateStreamingHandoff (cognitive 18) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/StreamHandoffRDD.scala:213 — StreamHandoffRDD.iterateStreamingHandoff has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 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.
D2 · Cognitive Complexity · CarbonInsertIntoWithDf.process (cognitive 18) · ×1
  • CarbonInsertIntoWithDf.process (cognitive 18) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala:61 — CarbonInsertIntoWithDf.process has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 3, 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.
D2 · Cognitive Complexity · CommonLoadUtils.getConvertedInternalRow (cognitive 18) · ×1
  • CommonLoadUtils.getConvertedInternalRow (cognitive 18) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:760 — CommonLoadUtils.getConvertedInternalRow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4, 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.
D2 · Cognitive Complexity · RefreshCarbonTableCommand.processMetadata (cognitive 18) · ×1
  • RefreshCarbonTableCommand.processMetadata (cognitive 18) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/RefreshCarbonTableCommand.scala:56 — RefreshCarbonTableCommand.processMetadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · CarbonCreateMVCommand.checkQuery (cognitive 18) · ×1
  • CarbonCreateMVCommand.checkQuery (cognitive 18) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/view/CarbonCreateMVCommand.scala:495 — CarbonCreateMVCommand.checkQuery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 6 (8 pts), boolean chains 1 (nesting depth added 4). 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.
D2 · Cognitive Complexity · CarbonSQLHadoopMapReduceCommitProtocol.commitJob (cognitive 18) · ×1
  • CarbonSQLHadoopMapReduceCommitProtocol.commitJob (cognitive 18) integration/spark/src/main/scala/org/apache/spark/sql/execution/datasources/SparkCarbonTableFormat.scala:265 — CarbonSQLHadoopMapReduceCommitProtocol.commitJob has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 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.
D2 · Cognitive Complexity · CarbonSecondaryIndexRDD.internalGetPartitions (cognitive 18) · ×1
  • CarbonSecondaryIndexRDD.internalGetPartitions (cognitive 18) integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/rdd/CarbonSecondaryIndexRDD.scala:181 — CarbonSecondaryIndexRDD.internalGetPartitions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (6 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.
D2 · Cognitive Complexity · ModularPlanRule.apply (cognitive 18) · ×1
  • ModularPlanRule.apply (cognitive 18) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/modular/ModularPlanSignatureGenerator.scala:37 — ModularPlanRule.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 4). 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.
D2 · Cognitive Complexity · HarmonizedRelation.canHarmonize (cognitive 18) · ×1
  • HarmonizedRelation.canHarmonize (cognitive 18) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/modular/ModularRelation.scala:87 — HarmonizedRelation.canHarmonize has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 6 (7 pts), boolean chains 2 (nesting depth added 6). 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.
D2 · Cognitive Complexity · LogicalPlanRule.apply (cognitive 18) · ×1
  • LogicalPlanRule.apply (cognitive 18) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/LogicalPlanSignatureGenerator.scala:56 — LogicalPlanRule.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, match/switch 1 (nesting depth added 4). 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.
D2 · Cognitive Complexity · CleanupQualifier.cleanupQualifier (cognitive 18) · ×1
  • CleanupQualifier.cleanupQualifier (cognitive 18) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/SQLBuilder.scala:108 — CleanupQualifier.cleanupQualifier has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (7 pts), boolean chains 2 (nesting depth added 9). 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.
D2 · Cognitive Complexity · ArrowWriter.createFieldWriter (cognitive 17) · ×1
  • ArrowWriter.createFieldWriter (cognitive 17) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/arrow/ArrowWriter.java:100 — ArrowWriter.createFieldWriter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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.
D2 · Cognitive Complexity · AbstractFactDataWriter.commitCurrentFile (cognitive 17) · ×1
  • AbstractFactDataWriter.commitCurrentFile (cognitive 17) REDACTED:263 — AbstractFactDataWriter.commitCurrentFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 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.
D2 · Cognitive Complexity · CarbonLoaderUtil.assignBlocksIgnoreDataLocality (cognitive 17) · ×1
  • CarbonLoaderUtil.assignBlocksIgnoreDataLocality (cognitive 17) processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:1000 — CarbonLoaderUtil.assignBlocksIgnoreDataLocality has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 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.
D2 · Cognitive Complexity · ColumnVectorProxy.putRowToColumnBatch (cognitive 17) · ×1
  • ColumnVectorProxy.putRowToColumnBatch (cognitive 17) integration/spark/src/main/java/org/apache/spark/sql/CarbonVectorProxy.java:151 — ColumnVectorProxy.putRowToColumnBatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16 (17 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.
D2 · Cognitive Complexity · CarbonVectorBatch.createDirectStreamReader (cognitive 17) · ×1
  • CarbonVectorBatch.createDirectStreamReader (cognitive 17) integration/presto/src/main/java/org/apache/carbondata/presto/CarbonVectorBatch.java:66 — CarbonVectorBatch.createDirectStreamReader has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · CarbonVectorizedRecordReader.initBatch (cognitive 17) · ×1
  • CarbonVectorizedRecordReader.initBatch (cognitive 17) hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.java:159 — CarbonVectorizedRecordReader.initBatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (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.
D2 · Cognitive Complexity · SafeFixedLengthDimensionDataChunkStore.fillVector (cognitive 17) · ×1
  • SafeFixedLengthDimensionDataChunkStore.fillVector (cognitive 17) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/SafeFixedLengthDimensionDataChunkStore.java:67 — SafeFixedLengthDimensionDataChunkStore.fillVector has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (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.
D2 · Cognitive Complexity · IndexFilter.checkIfFilterColumnExistsInTable (cognitive 17) · ×1
  • IndexFilter.checkIfFilterColumnExistsInTable (cognitive 17) core/src/main/java/org/apache/carbondata/core/index/IndexFilter.java:152 — IndexFilter.checkIfFilterColumnExistsInTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 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.
D2 · Cognitive Complexity · SegmentFileStore.writeSegmentFileForPartitionTable (cognitive 17) · ×1
  • SegmentFileStore.writeSegmentFileForPartitionTable (cognitive 17) core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java:166 — SegmentFileStore.writeSegmentFileForPartitionTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 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.
D2 · Cognitive Complexity · RangeExpressionEvaluator.checkLiteralValue (cognitive 17) · ×1
  • RangeExpressionEvaluator.checkLiteralValue (cognitive 17) core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.java:445 — RangeExpressionEvaluator.checkLiteralValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 3 (5 pts) (nesting depth added 10). 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.
D2 · Cognitive Complexity · SegmentUpdateStatusManager.getDeltaFiles (cognitive 17) · ×1
  • SegmentUpdateStatusManager.getDeltaFiles (cognitive 17) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java:284 — SegmentUpdateStatusManager.getDeltaFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 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.
D2 · Cognitive Complexity · CarbonUtil.getBlockId (cognitive 17) · ×1
  • CarbonUtil.getBlockId (cognitive 17) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2846 — CarbonUtil.getBlockId has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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.
D2 · Cognitive Complexity · CarbonUtil.getLocalDictionaryModel (cognitive 17) · ×1
  • CarbonUtil.getLocalDictionaryModel (cognitive 17) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:3100 — CarbonUtil.getLocalDictionaryModel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), ternaries 1 (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.
D2 · Cognitive Complexity · CarbonUtil.getRangeIndex (cognitive 17) · ×1
  • CarbonUtil.getRangeIndex (cognitive 17) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1542 — CarbonUtil.getRangeIndex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 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.
D2 · Cognitive Complexity · TrashUtil.emptyTrash (cognitive 17) · ×1
  • TrashUtil.emptyTrash (cognitive 17) core/src/main/java/org/apache/carbondata/core/util/TrashUtil.java:203 — TrashUtil.emptyTrash has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · DistributedPruneRDD.internalCompute (cognitive 17) · ×1
  • DistributedPruneRDD.internalCompute (cognitive 17) integration/spark/src/main/scala/org/apache/carbondata/indexserver/DistributedPruneRDD.scala:67 — DistributedPruneRDD.internalCompute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
D2 · Cognitive Complexity · CarbonMergerRDD.internalCompute (cognitive 17) · ×1
  • CarbonMergerRDD.internalCompute (cognitive 17) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:117 — CarbonMergerRDD.internalCompute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, error handling 2 (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.
D2 · Cognitive Complexity · CommonUtil.convertSparkComplexTypeToCarbonObject (cognitive 17) · ×1
  • CommonUtil.convertSparkComplexTypeToCarbonObject (cognitive 17) integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala:987 — CommonUtil.convertSparkComplexTypeToCarbonObject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (6 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · CommonLoadUtils.getSegmentMetaDataInfoFromAccumulator (cognitive 17) · ×1
  • CommonLoadUtils.getSegmentMetaDataInfoFromAccumulator (cognitive 17) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala:1192 — CommonLoadUtils.getSegmentMetaDataInfoFromAccumulator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (4 pts) (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.
D2 · Cognitive Complexity · CarbonMergeDataSetUtil.getSplitsAndLoadToCache (cognitive 17) · ×1
  • CarbonMergeDataSetUtil.getSplitsAndLoadToCache (cognitive 17) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetUtil.scala:383 — CarbonMergeDataSetUtil.getSplitsAndLoadToCache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), 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.
D2 · Cognitive Complexity · CarbonDescribeFormattedCommand.getLocalDictDesc (cognitive 17) · ×1
  • CarbonDescribeFormattedCommand.getLocalDictDesc (cognitive 17) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala:328 — CarbonDescribeFormattedCommand.getLocalDictDesc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3 (nesting depth added 8). 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.
D2 · Cognitive Complexity · CarbonSourceStrategy.pruneFilterProject (cognitive 17) · ×1
  • CarbonSourceStrategy.pruneFilterProject (cognitive 17) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonSourceStrategy.scala:144 — CarbonSourceStrategy.pruneFilterProject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, match/switch 2, error handling 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.
D2 · Cognitive Complexity · CarbonFileMetastore.readCarbonSchema (cognitive 17) · ×1
  • CarbonFileMetastore.readCarbonSchema (cognitive 17) integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala:279 — CarbonFileMetastore.readCarbonSchema has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 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.
D2 · Cognitive Complexity · CarbonSparkSqlParserUtil.alterTableAddColumns (cognitive 17) · ×1
  • CarbonSparkSqlParserUtil.alterTableAddColumns (cognitive 17) integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala:481 — CarbonSparkSqlParserUtil.alterTableAddColumns 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.
D2 · Cognitive Complexity · carbon_reader.make_carbon_reader (cognitive 17) · ×1
  • carbon_reader.make_carbon_reader (cognitive 17) python/pycarbon/core/carbon_reader.py:47 — carbon_reader.make_carbon_reader has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 2 (3 pts), 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.
D2 · Cognitive Complexity · Blocklet.computePercentage (cognitive 16) · ×1
  • Blocklet.computePercentage (cognitive 16) tools/cli/src/main/java/org/apache/carbondata/tool/DataFile.java:447 — Blocklet.computePercentage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · StreamSegment.open (cognitive 16) · ×1
  • StreamSegment.open (cognitive 16) streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:73 — StreamSegment.open has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · AvroCarbonWriter.avroPrimitiveFieldToObject (cognitive 16) · ×1
  • AvroCarbonWriter.avroPrimitiveFieldToObject (cognitive 16) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:346 — AvroCarbonWriter.avroPrimitiveFieldToObject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · CarbonWriterBuilder.buildCarbonTable (cognitive 16) · ×1
  • CarbonWriterBuilder.buildCarbonTable (cognitive 16) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java:994 — CarbonWriterBuilder.buildCarbonTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 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.
D2 · Cognitive Complexity · JsonStreamReader.getJsonRecord (cognitive 16) · ×1
  • JsonStreamReader.getJsonRecord (cognitive 16) processing/src/main/java/org/apache/carbondata/processing/loading/jsoninput/JsonStreamReader.java:52 — JsonStreamReader.getJsonRecord has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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.
D2 · Cognitive Complexity · DataWriterProcessorStepImpl.close (cognitive 16) · ×1
  • DataWriterProcessorStepImpl.close (cognitive 16) processing/src/main/java/org/apache/carbondata/processing/loading/steps/DataWriterProcessorStepImpl.java:240 — DataWriterProcessorStepImpl.close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 1 (3 pts), loops 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.
D2 · Cognitive Complexity · DataLoadProcessBuilder.setSortColumnInfo (cognitive 16) · ×1
  • DataLoadProcessBuilder.setSortColumnInfo (cognitive 16) processing/src/main/java/org/apache/carbondata/processing/loading/DataLoadProcessBuilder.java:416 — DataLoadProcessBuilder.setSortColumnInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (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.
D2 · Cognitive Complexity · CompactionResultSortProcessor.prepareRowObjectForSorting (cognitive 16) · ×1
  • CompactionResultSortProcessor.prepareRowObjectForSorting (cognitive 16) processing/src/main/java/org/apache/carbondata/processing/merger/CompactionResultSortProcessor.java:318 — CompactionResultSortProcessor.prepareRowObjectForSorting has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · CarbonFactDataWriterImplV3.writeTablePage (cognitive 16) · ×1
  • CarbonFactDataWriterImplV3.writeTablePage (cognitive 16) processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java:142 — CarbonFactDataWriterImplV3.writeTablePage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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.
D2 · Cognitive Complexity · SparkDataTypeConverterImpl.convertCarbonSchemaToSparkSchema (cognitive 16) · ×1
  • SparkDataTypeConverterImpl.convertCarbonSchemaToSparkSchema (cognitive 16) integration/spark/src/main/java/org/apache/carbondata/converter/SparkDataTypeConverterImpl.java:147 — SparkDataTypeConverterImpl.convertCarbonSchemaToSparkSchema has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
D2 · Cognitive Complexity · Util.convertCarbonToSparkDataType (cognitive 16) · ×1
  • Util.convertCarbonToSparkDataType (cognitive 16) integration/spark/src/main/java/org/apache/carbondata/spark/util/Util.java:62 — Util.convertCarbonToSparkDataType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 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.
D2 · Cognitive Complexity · DimensionChunkReaderV3.decodeDimensionLegacy (cognitive 16) · ×1
  • DimensionChunkReaderV3.decodeDimensionLegacy (cognitive 16) core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/DimensionChunkReaderV3.java:341 — DimensionChunkReaderV3.decodeDimensionLegacy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (7 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.
D2 · Cognitive Complexity · LocalDictDimensionDataChunkStore.fillVector (cognitive 16) · ×1
  • LocalDictDimensionDataChunkStore.fillVector (cognitive 16) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/LocalDictDimensionDataChunkStore.java:65 — LocalDictDimensionDataChunkStore.fillVector has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 1 (3 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · ColumnPageWrapper.fillRow (cognitive 16) · ×1
  • ColumnPageWrapper.fillRow (cognitive 16) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/ColumnPageWrapper.java:197 — ColumnPageWrapper.fillRow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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.
D2 · Cognitive Complexity · ColumnPage.getPageLengthInBytes (cognitive 16) · ×1
  • ColumnPage.getPageLengthInBytes (cognitive 16) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java:703 — ColumnPage.getPageLengthInBytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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.
D2 · Cognitive Complexity · IndexChooser.extractColumnExpression (cognitive 16) · ×1
  • IndexChooser.extractColumnExpression (cognitive 16) core/src/main/java/org/apache/carbondata/core/index/IndexChooser.java:253 — IndexChooser.extractColumnExpression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (3 pts), 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.
D2 · Cognitive Complexity · IndexStoreManager.getIndex (cognitive 16) · ×1
  • IndexStoreManager.getIndex (cognitive 16) core/src/main/java/org/apache/carbondata/core/index/IndexStoreManager.java:117 — IndexStoreManager.getIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · BlockletIndexFactory.clear (cognitive 16) · ×1
  • BlockletIndexFactory.clear (cognitive 16) core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndexFactory.java:475 — BlockletIndexFactory.clear 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.
D2 · Cognitive Complexity · BlockletIndexFactory.getIndexes (cognitive 16) · ×1
  • BlockletIndexFactory.getIndexes (cognitive 16) core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndexFactory.java:147 — BlockletIndexFactory.getIndexes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (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.
D2 · Cognitive Complexity · DictionaryBasedResultCollector.initDimensionAndMeasureIndexesForFillingData (cognitive 16) · ×1
  • DictionaryBasedResultCollector.initDimensionAndMeasureIndexesForFillingData (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/DictionaryBasedResultCollector.java:351 — DictionaryBasedResultCollector.initDimensionAndMeasureIndexesForFillingData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 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.
D2 · Cognitive Complexity · RestructureBasedVectorResultCollector.fillDataForNonExistingMeasures (cognitive 16) · ×1
  • RestructureBasedVectorResultCollector.fillDataForNonExistingMeasures (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedVectorResultCollector.java:202 — RestructureBasedVectorResultCollector.fillDataForNonExistingMeasures has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
D2 · Cognitive Complexity · ResultCollectorFactory.getScannedResultCollector (cognitive 16) · ×1
  • ResultCollectorFactory.getScannedResultCollector (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/collector/ResultCollectorFactory.java:52 — ResultCollectorFactory.getScannedResultCollector has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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.
D2 · Cognitive Complexity · GreaterThanEqualToExpression.evaluate (cognitive 16) · ×1
  • GreaterThanEqualToExpression.evaluate (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanEqualToExpression.java:36 — GreaterThanEqualToExpression.evaluate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · GreaterThanExpression.evaluate (cognitive 16) · ×1
  • GreaterThanExpression.evaluate (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanExpression.java:37 — GreaterThanExpression.evaluate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · LessThanEqualToExpression.evaluate (cognitive 16) · ×1
  • LessThanEqualToExpression.evaluate (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/LessThanEqualToExpression.java:36 — LessThanEqualToExpression.evaluate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · LessThanExpression.evaluate (cognitive 16) · ×1
  • LessThanExpression.evaluate (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/LessThanExpression.java:37 — LessThanExpression.evaluate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · ExpressionResult.equals (cognitive 16) · ×1
  • ExpressionResult.equals (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:489 — ExpressionResult.equals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, error handling 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.
D2 · Cognitive Complexity · ExcludeFilterExecutorImpl.getFilteredIndexesUsingPrvBitset (cognitive 16) · ×1
  • ExcludeFilterExecutorImpl.getFilteredIndexesUsingPrvBitset (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:303 — ExcludeFilterExecutorImpl.getFilteredIndexesUsingPrvBitset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanEqualFilterExecutorImpl.isScanRequired (cognitive 16) · ×1
  • RowLevelRangeGreaterThanEqualFilterExecutorImpl.isScanRequired (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:116 — RowLevelRangeGreaterThanEqualFilterExecutorImpl.isScanRequired 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.
D2 · Cognitive Complexity · RowLevelRangeGreaterThanFilterExecutorImpl.isScanRequired (cognitive 16) · ×1
  • RowLevelRangeGreaterThanFilterExecutorImpl.isScanRequired (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:118 — RowLevelRangeGreaterThanFilterExecutorImpl.isScanRequired 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanEqualFilterExecutorImpl.isScanRequired (cognitive 16) · ×1
  • RowLevelRangeLessThanEqualFilterExecutorImpl.isScanRequired (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:116 — RowLevelRangeLessThanEqualFilterExecutorImpl.isScanRequired 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.
D2 · Cognitive Complexity · RowLevelRangeLessThanFilterExecutorImpl.isScanRequired (cognitive 16) · ×1
  • RowLevelRangeLessThanFilterExecutorImpl.isScanRequired (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:116 — RowLevelRangeLessThanFilterExecutorImpl.isScanRequired 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.
D2 · Cognitive Complexity · ColumnDriftRawResultIterator.initForColumnDrift (cognitive 16) · ×1
  • ColumnDriftRawResultIterator.initForColumnDrift (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/result/iterator/ColumnDriftRawResultIterator.java:65 — ColumnDriftRawResultIterator.initForColumnDrift has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (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.
D2 · Cognitive Complexity · BlockletFullScanner.scanBlocklet (cognitive 16) · ×1
  • BlockletFullScanner.scanBlocklet (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFullScanner.java:60 — BlockletFullScanner.scanBlocklet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (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.
D2 · Cognitive Complexity · ByteArrayWrapper.equals (cognitive 16) · ×1
  • ByteArrayWrapper.equals (cognitive 16) core/src/main/java/org/apache/carbondata/core/scan/wrappers/ByteArrayWrapper.java:149 — ByteArrayWrapper.equals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 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.
D2 · Cognitive Complexity · SegmentMetaDataInfoStats.getTableSegmentMetaDataInfo (cognitive 16) · ×1
  • SegmentMetaDataInfoStats.getTableSegmentMetaDataInfo (cognitive 16) core/src/main/java/org/apache/carbondata/core/segmentmeta/SegmentMetaDataInfoStats.java:59 — SegmentMetaDataInfoStats.getTableSegmentMetaDataInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · TaskStatistics.build (cognitive 16) · ×1
  • TaskStatistics.build (cognitive 16) core/src/main/java/org/apache/carbondata/core/stats/TaskStatistics.java:78 — TaskStatistics.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 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.
D2 · Cognitive Complexity · StreamPruner.listAllStreamFiles (cognitive 16) · ×1
  • StreamPruner.listAllStreamFiles (cognitive 16) core/src/main/java/org/apache/carbondata/core/stream/StreamPruner.java:104 — StreamPruner.listAllStreamFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (11 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.
D2 · Cognitive Complexity · DataTypeUtil.getBytesBasedOnDataTypeForNoDictionaryColumn (cognitive 16) · ×1
  • DataTypeUtil.getBytesBasedOnDataTypeForNoDictionaryColumn (cognitive 16) core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java:389 — DataTypeUtil.getBytesBasedOnDataTypeForNoDictionaryColumn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), error handling 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · MVManager.getUpdatedSegmentMap (cognitive 16) · ×1
  • MVManager.getUpdatedSegmentMap (cognitive 16) core/src/main/java/org/apache/carbondata/core/view/MVManager.java:241 — MVManager.getUpdatedSegmentMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 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.
D2 · Cognitive Complexity · CarbonDataRDDFactory.handleSegmentMerging (cognitive 16) · ×1
  • CarbonDataRDDFactory.handleSegmentMerging (cognitive 16) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala:626 — CarbonDataRDDFactory.handleSegmentMerging has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (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.
D2 · Cognitive Complexity · CarbonMergerRDD.getTaskNumberBasedOnID (cognitive 16) · ×1
  • CarbonMergerRDD.getTaskNumberBasedOnID (cognitive 16) integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonMergerRDD.scala:736 — CarbonMergerRDD.getTaskNumberBasedOnID has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 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.
D2 · Cognitive Complexity · CarbonStreamerConfig.setConfigsToCarbonProperty (cognitive 16) · ×1
  • CarbonStreamerConfig.setConfigsToCarbonProperty (cognitive 16) integration/spark/src/main/scala/org/apache/carbondata/streamer/CarbonStreamerConfig.scala:177 — CarbonStreamerConfig.setConfigsToCarbonProperty has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. 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.
D2 · Cognitive Complexity · CarbonSparkDataSourceUtil.prepareLoadModel (cognitive 16) · ×1
  • CarbonSparkDataSourceUtil.prepareLoadModel (cognitive 16) integration/spark/src/main/scala/org/apache/spark/sql/carbondata/execution/datasources/CarbonSparkDataSourceUtil.scala:229 — CarbonSparkDataSourceUtil.prepareLoadModel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 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.
D2 · Cognitive Complexity · DDLHelper.setProperties (cognitive 16) · ×1
  • DDLHelper.setProperties (cognitive 16) integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/DDLHelper.scala:352 — DDLHelper.setProperties has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 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.
D2 · Cognitive Complexity · CarbonFilters.transformExpression (cognitive 16) · ×1
  • CarbonFilters.transformExpression (cognitive 16) integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonFilters.scala:462 — CarbonFilters.transformExpression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 5). 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.
D2 · Cognitive Complexity · AlterTableUtil.validateColumnDataType (cognitive 16) · ×1
  • AlterTableUtil.validateColumnDataType (cognitive 16) integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala:1169 — AlterTableUtil.validateColumnDataType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · HarmonizeDimensionTable.apply (cognitive 16) · ×1
  • HarmonizeDimensionTable.apply (cognitive 16) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/modular/Harmonizer.scala:67 — HarmonizeDimensionTable.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 3 (6 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · Printers.formatExpressionsInUDF (cognitive 16) · ×1
  • Printers.formatExpressionsInUDF (cognitive 16) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Printers.scala:381 — Printers.formatExpressionsInUDF has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 5). 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.
D2 · Cognitive Complexity · SQLBuildDSL.addGroupingSetIfNeeded (cognitive 16) · ×1
  • SQLBuildDSL.addGroupingSetIfNeeded (cognitive 16) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/SQLBuildDSL.scala:383 — SQLBuildDSL.addGroupingSetIfNeeded has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 3, loops 1 (2 pts) (nesting depth added 8). 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 36 shared lines) · ×1
  • Near-duplicate member family (5 members, 36 shared lines) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:374 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:374-442 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:217-322 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:275-379 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:217-303 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:214-299 — These 5 members are variants of one another: a block of 36 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 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 · Near-duplicate member family (4 members, 29 shared lines) · ×1
  • Near-duplicate member family (4 members, 29 shared lines) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:344 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:344-398 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:157-209 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:323-376 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:319-371 — These 4 members are variants of one another: a block of 29 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, 32 shared lines) · ×1
  • Near-duplicate member family (3 members, 32 shared lines) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:126 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:126-309 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala:61-186 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:93-209 — These 3 members are variants of one another: a block of 32 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 pair (91 shared lines) · ×1
  • Near-duplicate member pair (91 shared lines) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:303 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:303-450 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:330-544 — These two members are variants of one another: 91 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 · Near-duplicate member pair (48 shared lines) · ×1
  • Near-duplicate member pair (48 shared lines) sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:184 — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:184-304 | sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:406-508 — These two members are variants of one another: 48 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 · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:471 — processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:471-601 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortParameters.java:657-741 — These two members are variants of one another: 37 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 · Near-duplicate member pair (31 shared lines) · ×1
  • Near-duplicate member pair (31 shared lines) core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:85 — core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:85-120 | core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/AbstractNonDictionaryVectorFiller.java:133-169 — These two members are variants of one another: 31 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 · Near-duplicate member pair (23 shared lines) · ×1
  • Near-duplicate member pair (23 shared lines) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:43 — core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/InExpression.java:43-97 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/NotInExpression.java:43-108 — These two members are variants of one another: 23 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 (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java:58 — core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java:58-92 | core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java:94-128 — 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 copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) processing/src/main/java/org/apache/carbondata/processing/loading/steps/DataConverterProcessorStepImpl.java:93 — processing/src/main/java/org/apache/carbondata/processing/loading/steps/DataConverterProcessorStepImpl.java:93-128 | processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:130-165 — 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 (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:425 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:425-449 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:420-444 — 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.
D4 · Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (14 members, 50+ identical tokens) core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:40 — core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:40-61 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:65-88 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:97-118 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:122-145 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:151-172 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:176-199 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:205-226 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:230-253 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:310-331 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:335-358 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:364-385 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:389-412 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:418-439 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:443-466 — These 14 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 14 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 14 times.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:276 — core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:276-377 | core/src/main/java/org/apache/carbondata/core/view/MVManager.java:334-383 | integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:264-345 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:161-268 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:1046-1136 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:237-381 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:73-116 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:143-179 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:184-221 — These 9 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 9 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 9 times.
D4 · Code Duplication · Duplicated block (30–31 lines × 4) · ×1
  • Duplicated block (30–31 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:121 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:121-151 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:123-153 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:121-150 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:121-150 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.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.
D4 · Code Duplication · Duplicated block (31 lines × 3) · ×1
  • Duplicated block (31 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:72 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:72-102 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:78-108 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRestructureBasedRawResultCollector.java:50-80 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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 `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:104` calls `incrementScannedResultRowCounter` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:113` 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.
D4 · Code Duplication · Duplicated block (23–31 lines × 2) · ×1
  • Duplicated block (23–31 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:474 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:474-504 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:550-572 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:474` 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.
D4 · Code Duplication · Duplicated block (29–30 lines × 2) · ×1
  • Duplicated block (29–30 lines × 2) core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:155 — core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:155-184 | core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:233-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 `core/src/main/java/org/apache/carbondata/core/util/ByteUtil.java:155` 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.
D4 · Code Duplication · Duplicated block (24–28 lines × 2) · ×1
  • Duplicated block (24–28 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:494 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:494-521 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:597-620 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:494` 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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) processing/src/main/java/org/apache/carbondata/processing/loading/steps/DataConverterProcessorStepImpl.java:101 — processing/src/main/java/org/apache/carbondata/processing/loading/steps/DataConverterProcessorStepImpl.java:101-128 | processing/src/main/java/org/apache/carbondata/processing/loading/steps/InputProcessorStepWithNoConverterImpl.java:138-165 — 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/carbondata/processing/loading/steps/DataConverterProcessorStepImpl.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.
D4 · Code Duplication · Duplicated block (25–26 lines × 5) · ×1
  • Duplicated block (25–26 lines × 5) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:409 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:409-434 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:249-274 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:306-331 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:241-265 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:238-262 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:409` 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.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:559 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:559-583 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:567-592 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 401 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:559` 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.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:368 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:368-392 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java:405-427 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 125 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:368` 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.
D4 · Code Duplication · Duplicated block (18–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:478 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:478-499 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:546-563 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:478` 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.
D4 · Code Duplication · Duplicated block (19–21 lines × 4) · ×1
  • Duplicated block (19–21 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:471 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:471-489 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:539-557 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:467-487 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:543-562 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 401 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:471` 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.
D4 · Code Duplication · Duplicated block (12–21 lines × 2) · ×1
  • Duplicated block (12–21 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:483 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:483-503 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:542-553 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:483` 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.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/CustomTypeDictionaryVisitor.java:58 — core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/CustomTypeDictionaryVisitor.java:58-76 | core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/RangeDirectDictionaryVisitor.java:64-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 `core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/CustomTypeDictionaryVisitor.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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:511 — core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:511-529 | core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:614-633 — 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 `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:511` 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, `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:634` calls `add` and `core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java:530` 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.
D4 · Code Duplication · Duplicated block (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:83 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:83-101 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:90-108 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:71-89 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:68-86 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:83` 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:105 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:105-123 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:93-111 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:90-107 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:105` 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.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:578 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:578-595 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:585-602 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:596-613 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:604-621 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:500 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:500-516 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:504-521 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:500` 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 4) · ×1
  • Duplicated block (16–17 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:346 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:346-362 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:158-173 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:325-340 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:321-336 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:346` 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 · Duplicated block (15–16 lines × 4) · ×1
  • Duplicated block (15–16 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanEqualToExpression.java:38 — core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanEqualToExpression.java:38-52 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/GreaterThanExpression.java:39-54 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/LessThanEqualToExpression.java:38-52 | core/src/main/java/org/apache/carbondata/core/scan/expression/conditional/StartsWithExpression.java:39-54 — 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) integration/flink/src/main/java/org/apache/carbon/flink/CarbonWriter.java:87 — integration/flink/src/main/java/org/apache/carbon/flink/CarbonWriter.java:87-102 | integration/flink/src/main/java/org/apache/carbon/flink/CarbonWriter.java:134-148 — 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 `integration/flink/src/main/java/org/apache/carbon/flink/CarbonWriter.java:87` 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 4) · ×1
  • Duplicated block (13–15 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:175 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:175-189 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:233-247 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:174-188 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:174-186 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.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.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:219 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:219-233 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:277-290 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:219-232 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:216-229 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:219` 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 · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:318 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:318-332 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:337-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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java:318` 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.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:134 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:134-147 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:146-159 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java:122-135 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.java:123-136 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:134` 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 · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2955 — core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2955-2966 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2987-3000 | core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:3015-3027 — 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 `core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2955` 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, `core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:3002` calls `asList`, `contains`, `getColumnName` and `core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:2968` 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:284 — core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:284-293 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:1089-1101 — 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 `core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:284` 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 · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:487 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:487-499 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:537-545 — 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:487` 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 7) · ×1
  • Duplicated block (9–12 lines × 7) core/src/main/java/org/apache/carbondata/core/view/MVManager.java:370 — core/src/main/java/org/apache/carbondata/core/view/MVManager.java:370-381 | integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/load/CarbonInternalLoaderUtil.java:334-343 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:257-266 | processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java:369-379 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:106-115 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:169-178 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:212-220 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/carbondata/core/view/MVManager.java:370` 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 4) · ×1
  • Duplicated block (9–12 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:70 — core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:70-81 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedVectorResultCollector.java:106-114 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java:76-87 | core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRestructureBasedRawResultCollector.java:48-59 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java` and `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RowIdRawBasedResultCollector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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 `core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RawBasedResultCollector.java:70` 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 · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:91 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:91-102 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:90-101 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:90-101 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 253 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:91` 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.
D4 · Code Duplication · Duplicated block (2–11 lines × 4) · ×1
  • Duplicated block (2–11 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:294 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:294-295 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:386-396 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:197-207 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:351-352 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:294` 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.
D4 · Code Duplication · Duplicated block (10 lines × 8) · ×1
  • Duplicated block (10 lines × 8) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:224 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:224-233 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:353-362 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:164-173 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:281-290 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:223-232 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:331-340 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:220-229 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:327-336 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:224` 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 · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:425 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:425-434 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:422-430 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:403-412 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:398-407 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.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. 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.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:363 — core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:363-373 | core/src/main/java/org/apache/carbondata/core/view/MVManager.java:371-382 | processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java:1124-1134 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:107-116 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:170-179 | streaming/src/main/java/org/apache/carbondata/streaming/segment/StreamSegment.java:213-221 — 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 `core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java:363` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 6) · ×1
  • Duplicated block (8–9 lines × 6) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:108 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:108-115 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RangeValueFilterExecutorImpl.java:386-394 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:227-234 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:284-291 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:226-233 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:223-230 — 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 6 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (3–9 lines × 3) · ×1
  • Duplicated block (3–9 lines × 3) core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:205 — core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:205-207 | core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:231-238 | core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:259-267 — 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 `core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:205` 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 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.
D4 · Code Duplication · Duplicated block (8 lines × 8) · ×1
  • Duplicated block (8 lines × 8) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:283 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:283-290 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:375-382 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:186-193 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:340-347 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:274-281 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:353-360 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:271-278 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:349-356 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 370 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:352 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:352-359 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:379-386 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:428-435 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:454-461 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:352` 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, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:378` calls `isExplicitSorted` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:351` 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.
D4 · Code Duplication · Duplicated block (4–8 lines × 4) · ×1
  • Duplicated block (4–8 lines × 4) core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:202 — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:202-205 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:217-220 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:237-244 | core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:254-261 — 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 `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:202` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `int` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:223` calls `putLong` and `core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java:207` 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.
D4 · Code Duplication · Duplicated block (7 lines × 14) · ×1
  • Duplicated block (7 lines × 14) core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:41 — core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:41-47 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:66-72 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:98-104 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:123-129 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:152-158 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:177-183 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:206-212 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:231-237 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:311-317 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:336-342 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:365-371 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:390-396 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:419-425 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:444-450 — all 14 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 `core/src/main/java/org/apache/carbondata/core/scan/result/vector/MeasureDataVectorProcessor.java:41` 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 · Duplicated block (7 lines × 11) · ×1
  • Duplicated block (7 lines × 11) core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:129 — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:129-135 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:144-150 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:224-230 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:285-291 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:377-383 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:188-194 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java:342-348 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:276-282 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:355-361 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:273-279 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.java:351-357 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 147 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, `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecutorImpl.java:137` calls `decodeAllColumnPages` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecutorImpl.java:151` 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) integration/hive/src/main/java/org/apache/carbondata/hive/WritableReadSupport.java:117 — integration/hive/src/main/java/org/apache/carbondata/hive/WritableReadSupport.java:117-122 | integration/hive/src/main/java/org/apache/carbondata/hive/WritableReadSupport.java:174-180 — 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 `integration/hive/src/main/java/org/apache/carbondata/hive/WritableReadSupport.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.
D4 · Code Duplication · Duplicated block (2–6 lines × 3) · ×1
  • Duplicated block (2–6 lines × 3) core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExecutorUtil.java:67 — core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExecutorUtil.java:67-68 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:418-423 | core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java:396-401 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java` and `core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 253 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 `core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExecutorUtil.java:67` 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 3) · ×1
  • Duplicated block (5–6 lines × 3) core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:217 — core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:217-222 | core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:224-229 | core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:253-257 — 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 `core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.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. 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.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:95 — core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:95-99 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:106-110 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:117-121 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:128-132 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:139-143 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:150-154 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:161-165 | core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java:185-189 — all 8 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 `core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.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.
D4 · Code Duplication · Duplicated block (2–5 lines × 3) · ×1
  • Duplicated block (2–5 lines × 3) core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:208 — core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:208-209 | core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:216-220 | core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.java:244-248 — 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 `core/src/main/java/org/apache/carbondata/core/stats/DriverQueryStatisticsRecorderImpl.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. 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.
D4 · Code Duplication · Duplicated block (21 lines × 9) · ×1
  • Duplicated block (21 lines × 9) common/src/main/java/org/apache/carbondata/common/exceptions/sql/MalformedCarbonCommandException.java:46 — common/src/main/java/org/apache/carbondata/common/exceptions/sql/MalformedCarbonCommandException.java:46-66 | core/src/main/java/org/apache/carbondata/core/datastore/exception/CarbonDataWriterException.java:39-79 | core/src/main/java/org/apache/carbondata/core/datastore/exception/IndexBuilderException.java:42-83 | core/src/main/java/org/apache/carbondata/core/exception/InvalidConfigurationException.java:37-57 | core/src/main/java/org/apache/carbondata/core/localdictionary/exception/DictionaryThresholdReachedException.java:38-79 | core/src/main/java/org/apache/carbondata/core/scan/expression/exception/FilterUnsupportedException.java:37-65 | processing/src/main/java/org/apache/carbondata/processing/loading/exception/BadRecordFoundException.java:36-57 | processing/src/main/java/org/apache/carbondata/processing/loading/exception/CarbonDataLoadingException.java:36-74 | processing/src/main/java/org/apache/carbondata/processing/sort/exception/CarbonSortKeyAndGroupByException.java:39-88 — before extracting anything, compare `common/src/main/java/org/apache/carbondata/common/exceptions/sql/MalformedCarbonCommandException.java` and `core/src/main/java/org/apache/carbondata/core/exception/InvalidConfigurationException.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. 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.
D4 · Code Duplication · Duplicated block (41 lines × 4) · ×1
  • Duplicated block (41 lines × 4) core/src/main/java/org/apache/carbondata/core/datastore/exception/CarbonDataWriterException.java:39 — core/src/main/java/org/apache/carbondata/core/datastore/exception/CarbonDataWriterException.java:39-79 | core/src/main/java/org/apache/carbondata/core/datastore/exception/IndexBuilderException.java:42-83 | core/src/main/java/org/apache/carbondata/core/localdictionary/exception/DictionaryThresholdReachedException.java:38-79 | processing/src/main/java/org/apache/carbondata/processing/sort/exception/CarbonSortKeyAndGroupByException.java:39-88 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/exception/CarbonDataWriterException.java` and `core/src/main/java/org/apache/carbondata/core/datastore/exception/IndexBuilderException.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 150 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.
D4 · Code Duplication · Duplicated block (66 lines × 2) · ×1
  • Duplicated block (66 lines × 2) core/src/main/java/org/apache/carbondata/core/index/dev/cgindex/CoarseGrainIndex.java:1 — core/src/main/java/org/apache/carbondata/core/index/dev/cgindex/CoarseGrainIndex.java:1-67 | core/src/main/java/org/apache/carbondata/core/index/dev/fgindex/FineGrainIndex.java:1-66 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/index/dev/cgindex/CoarseGrainIndex.java` and `core/src/main/java/org/apache/carbondata/core/index/dev/fgindex/FineGrainIndex.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 `core/src/main/java/org/apache/carbondata/core/index/dev/cgindex/CoarseGrainIndex.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.
D4 · Code Duplication · Duplicated block (29 lines × 6) · ×1
  • Duplicated block (29 lines × 6) core/src/main/java/org/apache/carbondata/core/datastore/exception/CarbonDataWriterException.java:39 — core/src/main/java/org/apache/carbondata/core/datastore/exception/CarbonDataWriterException.java:39-79 | core/src/main/java/org/apache/carbondata/core/datastore/exception/IndexBuilderException.java:42-83 | core/src/main/java/org/apache/carbondata/core/localdictionary/exception/DictionaryThresholdReachedException.java:38-79 | core/src/main/java/org/apache/carbondata/core/scan/expression/exception/FilterUnsupportedException.java:37-65 | processing/src/main/java/org/apache/carbondata/processing/loading/exception/CarbonDataLoadingException.java:36-74 | processing/src/main/java/org/apache/carbondata/processing/sort/exception/CarbonSortKeyAndGroupByException.java:39-88 — before extracting anything, compare `core/src/main/java/org/apache/carbondata/core/datastore/exception/CarbonDataWriterException.java` and `core/src/main/java/org/apache/carbondata/core/datastore/exception/IndexBuilderException.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 150 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.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) processing/src/main/java/org/apache/carbondata/processing/exception/SliceMergerException.java:37 — processing/src/main/java/org/apache/carbondata/processing/exception/SliceMergerException.java:37-56 | processing/src/main/java/org/apache/carbondata/processing/loading/exception/CarbonDataLoadingException.java:36-74 | processing/src/main/java/org/apache/carbondata/processing/sort/exception/CarbonSortKeyAndGroupByException.java:39-88 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/exception/SliceMergerException.java` and `processing/src/main/java/org/apache/carbondata/processing/loading/exception/CarbonDataLoadingException.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. 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.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeFinalMergePageHolder.java:95 — processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeFinalMergePageHolder.java:95-106 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeInmemoryHolder.java:84-96 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeInmemoryMergeHolder.java:85-96 | processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java:303-314 | processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java:313-324 — before extracting anything, compare `processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/holder/UnsafeSortTempFileChunkHolder.java` and `processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortTempFileChunkHolder.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 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.
D4 · Code Duplication · Duplicated block (142 lines × 2) · ×1
  • Duplicated block (142 lines × 2) integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:247 — integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:247-388 | integration/spark/src/main/spark3.1/org/apache/spark/sql/SparkVersionAdapter.scala:277-418 — before extracting anything, compare `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala` and `integration/spark/src/main/spark3.1/org/apache/spark/sql/SparkVersionAdapter.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 171 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 `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:247` 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, `integration/spark/src/main/spark3.1/org/apache/spark/sql/SparkVersionAdapter.scala:274` calls `filterNot`, `contains` and `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:244` 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.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:103 — integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:103-132 | integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala:102-131 — before extracting anything, compare `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala` and `integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala` as WHOLE FILES: this scan already matched 3 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.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:245 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:245-266 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala:125-147 — before extracting anything, compare `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala` and `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:245` 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 · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:277 — integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:277-295 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala:159-177 | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala:172-190 — before extracting anything, compare `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala` and `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoWithDf.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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 `integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala:277` 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.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Printers.scala:202 — mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Printers.scala:202-218 | mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Printers.scala:220-233 — 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 `mv/plan/src/main/scala/org/apache/carbondata/mv/plans/util/Printers.scala:202` 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:312 — integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:312-324 | integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala:222-235 | integration/spark/src/main/spark3.1/org/apache/spark/sql/SparkVersionAdapter.scala:342-354 — before extracting anything, compare `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala` and `integration/spark/src/main/spark3.1/org/apache/spark/sql/SparkVersionAdapter.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 171 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 `integration/spark/src/main/common2.3and2.4/org/apache/spark/sql/SparkVersionAdapter.scala:312` 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) integration/spark/src/main/scala/org/apache/carbondata/indexserver/DistributedCountRDD.scala:49 — integration/spark/src/main/scala/org/apache/carbondata/indexserver/DistributedCountRDD.scala:49-55 | integration/spark/src/main/scala/org/apache/carbondata/indexserver/DistributedPruneRDD.scala:160-166 | integration/spark/src/main/scala/org/apache/carbondata/indexserver/DistributedShowCacheRDD.scala:43-49 | integration/spark/src/main/scala/org/apache/carbondata/indexserver/InvalidateSegmentCacheRDD.scala:46-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 all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (71–77 lines × 2) · ×1
  • Duplicated block (71–77 lines × 2) python/pycarbon/core/carbon_reader.py:65 — python/pycarbon/core/carbon_reader.py:65-141 | python/pycarbon/core/carbon_reader.py:236-306 — 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 `python/pycarbon/core/carbon_reader.py: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.
D4 · Code Duplication · Duplicated block (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) REDACTED:56 — REDACTED:56-88 | REDACTED:52-85 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:89` calls `form_ngram` and `REDACTED:90` 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.
D4 · Code Duplication · Duplicated block (23–26 lines × 2) · ×1
  • Duplicated block (23–26 lines × 2) REDACTED:110 — REDACTED:110-135 | REDACTED:96-118 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:120` calls `list` and `REDACTED: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.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) python/pycarbon/reader.py:88 — python/pycarbon/reader.py:88-99 | python/pycarbon/reader.py:102-113 | python/pycarbon/reader.py:132-143 | python/pycarbon/reader.py:146-157 — 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 `python/pycarbon/reader.py:88` 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.
D4 · Code Duplication · Duplicated block (14–18 lines × 2) · ×1
  • Duplicated block (14–18 lines × 2) examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3Example.java:101 — examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3Example.java:101-114 | examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3ReadExample.java:84-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3Example.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.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3ReadExample.java:45 — examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3ReadExample.java:45-62 | examples/spark/src/main/java/org/apache/carbondata/examples/sdk/SDKS3SchemaReadExample.java:36-51 — 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.
D4 · Code Duplication · Duplicated block (52–54 lines × 2) · ×1
  • Duplicated block (52–54 lines × 2) REDACTED:37 — REDACTED:37-90 | REDACTED:36-87 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 114 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 `REDACTED: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.
D4 · Code Duplication · Duplicated block (43–46 lines × 2) · ×1
  • Duplicated block (43–46 lines × 2) REDACTED:46 — REDACTED:46-88 | REDACTED:42-87 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 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 `REDACTED:46` 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, `REDACTED:90` calls `addSparkListener`, `CarbonSparkStreamingListener` and `REDACTED:89` 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.
D4 · Code Duplication · Duplicated block (33–43 lines × 5) · ×1
  • Duplicated block (33–43 lines × 5) examples/spark/src/main/scala/org/apache/carbondata/examples/CustomCompactionExample.scala:45 — examples/spark/src/main/scala/org/apache/carbondata/examples/CustomCompactionExample.scala:45-77 | examples/spark/src/main/scala/org/apache/carbondata/examples/DataManagementExample.scala:36-69 | REDACTED:47-80 | examples/spark/src/main/scala/org/apache/carbondata/examples/QuerySegmentExample.scala:44-80 | examples/spark/src/main/scala/org/apache/carbondata/examples/TableLevelCompactionOptionExample.scala:41-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 all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/spark/src/main/scala/org/apache/carbondata/examples/CustomCompactionExample.scala: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:43` calls `getInstance`, `addProperty` and `examples/spark/src/main/scala/org/apache/carbondata/examples/DataManagementExample.scala:35` 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.
D4 · Code Duplication · Duplicated block (11–30 lines × 2) · ×1
  • Duplicated block (11–30 lines × 2) examples/spark/src/main/scala/org/apache/carbondata/examples/AlterTableExample.scala:67 — examples/spark/src/main/scala/org/apache/carbondata/examples/AlterTableExample.scala:67-77 | examples/spark/src/main/scala/org/apache/carbondata/examples/DataUpdateDeleteExample.scala:91-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 `examples/spark/src/main/scala/org/apache/carbondata/examples/AlterTableExample.scala: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. 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.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) REDACTED:186 — REDACTED:186-208 | REDACTED:184-206 | REDACTED:190-212 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 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 `REDACTED:186` 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 6) · ×1
  • Duplicated block (13–14 lines × 6) examples/spark/src/main/scala/org/apache/carbondata/examples/DataFrameComplexTypeExample.scala:121 — examples/spark/src/main/scala/org/apache/carbondata/examples/DataFrameComplexTypeExample.scala:121-133 | examples/spark/src/main/scala/org/apache/carbondata/examples/DataFrameComplexTypeExample.scala:141-153 | REDACTED:102-115 | REDACTED:99-112 | REDACTED:103-116 | REDACTED:100-113 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 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, `REDACTED:118` calls `sql` and `REDACTED:120` 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.
D5 · Coupling · Unstable project carbondata-flink · ×1
  • Unstable project carbondata-flink — carbondata-flink has instability 0.83 with 1 dependents.
Minor — 972 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×921
  • Orphaned file integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVMatcher.scala: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 core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.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 core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.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 core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.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 integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala: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 integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala: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/carbondata/processing/util/CarbonLoaderUtil.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 integration/spark/src/main/scala/org/apache/spark/sql/catalyst/CarbonParserUtil.scala: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 integration/spark/src/main/scala/org/apache/spark/sql/optimizer/MVRewrite.scala: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/carbondata/processing/merger/CarbonDataMergerUtil.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 sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.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 core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.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 core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.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 integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala: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 integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/optimizer/CarbonSecondaryIndexOptimizer.scala: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 core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.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 integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala: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 integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala: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 integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala: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 hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.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 integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetCommand.scala: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 integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/merge/CarbonMergeDataSetUtil.scala: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 sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.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 core/src/main/java/org/apache/carbondata/core/scan/executor/impl/AbstractQueryExecutor.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 integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala: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.
  • + 896 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:83 — `!dimColEvaluatorInfoList.isEmpty() && !isDimensionPresentInCurrentBlock[0]` appears character-identically in 4 files — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.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/carbondata/processing/loading/model/CarbonLoadModelBuilder.java:204 — `!headerOption.equalsIgnoreCase("true") && !headerOption.equalsIgnoreCase("false")` appears character-identically in 2 files — processing/src/main/java/org/apache/carbondata/processing/loading/model/CarbonLoadModelBuilder.java, processing/src/main/java/org/apache/carbondata/processing/loading/model/LoadOption.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 core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:219 — `!isDimensionPresentInCurrentBlock[0] && !isMeasurePresentInCurrentBlock[0]` appears character-identically in 4 files — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.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 core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/MeasureColumnVisitor.java:67 — `!metadata.isIncludeFilter() && !evaluateResultListFinal .contains(CarbonCommonConstants.MEMBER_DEFAULT_VAL)` appears character-identically in 3 files — core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/MeasureColumnVisitor.java, core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/NoDictionaryTypeVisitor.java, core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/RangeNoDictionaryTypeVisitor.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 core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/CustomTypeDictionaryVisitor.java:65 — `!metadata.isIncludeFilter() && null != resolvedFilterObject && !resolvedFilterObject .getExcludeFilterList() .contains(CarbonCommonConstants…` appears character-identically in 2 files — core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/CustomTypeDictionaryVisitor.java, core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/resolverinfo/visitor/RangeDirectDictionaryVisitor.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 core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:96 — `!msrColEvalutorInfoList.isEmpty() && !isMeasurePresentInCurrentBlock[0]` appears character-identically in 4 files — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.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/carbondata/processing/loading/parser/impl/ArrayParserImpl.java:52 — `!value.isEmpty() && !value.equals(nullFormat) && !value.equals(CarbonCommonConstants.SIZE_ZERO_DATA_RETURN)` appears character-identically in 2 files — processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/ArrayParserImpl.java, processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/MapParserImpl.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 core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:903 — `(d1.doubleValue() == d2.doubleValue()) || (Double.isNaN(d1) && Double.isNaN(d2))` appears character-identically in 2 files — core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java, core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.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 core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java:326 — `(deletedRows == null || deletedRows.isEmpty()) && !(vectorInfo.vector instanceof SequentialFill)` appears character-identically in 5 files — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java, core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaIntegralCodec.java, core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveFloatingCodec.java, core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveIntegralCodec.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 hadoop/src/main/java/org/apache/carbondata/hadoop/CarbonRecordReader.java:87 — `(null != carbonInputSplit.getDetailInfo() && carbonInputSplit.getDetailInfo().getBlockFooterOffset() == 0L) || ( null == carbonInputSplit.ge…` appears character-identically in 2 files — hadoop/src/main/java/org/apache/carbondata/hadoop/CarbonRecordReader.java, hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.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 core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java:135 — `DataTypeUtil.isPrimitiveColumn(dataType) && dimColEvaluatorInfoList.get(0).getDimension().getDataType() != DataTypes.DATE` appears character-identically in 4 files — core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanEqualFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGreaterThanFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecutorImpl.java, core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanFilterExecutorImpl.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 integration/presto/src/main/prestodb/org/apache/carbondata/presto/readers/ComplexTypeStreamReader.java:176 — `DataTypes.isArrayType(dataType) || (DataTypes.isStructType(dataType))` appears character-identically in 2 files — integration/presto/src/main/prestodb/org/apache/carbondata/presto/readers/ComplexTypeStreamReader.java, integration/presto/src/main/prestosql/org/apache/carbondata/presto/readers/ComplexTypeStreamReader.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 integration/presto/src/main/prestodb/org/apache/carbondata/presto/impl/CarbonTableReader.java:155 — `carbonTableCacheModel != null && carbonTableCacheModel.getCarbonTable().isTransactionalTable()` appears character-identically in 2 files — integration/presto/src/main/prestodb/org/apache/carbondata/presto/impl/CarbonTableReader.java, integration/presto/src/main/prestosql/org/apache/carbondata/presto/impl/CarbonTableReader.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 integration/presto/src/main/prestodb/org/apache/carbondata/presto/impl/CarbonTableReader.java:142 — `carbonTableCacheModel == null || !carbonTableCacheModel.isValid()` appears character-identically in 2 files — integration/presto/src/main/prestodb/org/apache/carbondata/presto/impl/CarbonTableReader.java, integration/presto/src/main/prestosql/org/apache/carbondata/presto/impl/CarbonTableReader.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 integration/presto/src/main/prestodb/org/apache/carbondata/presto/CarbondataPageSourceProvider.java:90 — `carbonTableReader.config.getPushRowFilter() == null || "false" .equalsIgnoreCase(carbonTableReader.config.getPushRowFilter())` appears character-identically in 2 files — integration/presto/src/main/prestodb/org/apache/carbondata/presto/CarbondataPageSourceProvider.java, integration/presto/src/main/prestosql/org/apache/carbondata/presto/CarbondataPageSourceProvider.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 sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java:114 — `dataFiles == null || dataFiles.length == 0` appears character-identically in 5 files — sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java, sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CSVCarbonWriter.java, sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/JsonCarbonWriter.java, sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/ORCCarbonWriter.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 core/src/main/java/org/apache/carbondata/core/datastore/page/LazyColumnPage.java:56 — `dataType == DataTypes.BOOLEAN || dataType == DataTypes.BYTE` appears character-identically in 7 files — core/src/main/java/org/apache/carbondata/core/datastore/page/LazyColumnPage.java, core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java, core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/rle/RLECodec.java, core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.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 integration/presto/src/main/prestodb/org/apache/carbondata/presto/CarbondataPageSource.java:159 — `dataType == DataTypes.BOOLEAN || dataType == DataTypes.SHORT || dataType == DataTypes.INT || dataType == DataTypes.LONG` appears character-identically in 2 files — integration/presto/src/main/prestodb/org/apache/carbondata/presto/CarbondataPageSource.java, integration/presto/src/main/prestosql/org/apache/carbondata/presto/CarbondataPageSource.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 hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.java:170 — `dataType == DataTypes.BOOLEAN || dataType == DataTypes.SHORT || dataType == DataTypes.INT || dataType == DataTypes.LONG || dataType == DataT…` appears character-identically in 2 files — hadoop/src/main/java/org/apache/carbondata/hadoop/util/CarbonVectorizedRecordReader.java, integration/spark/src/main/java/org/apache/carbondata/spark/vectorreader/VectorizedCarbonRecordReader.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 core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/DefaultEncodingFactory.java:161 — `dataType == DataTypes.BYTE || dataType == DataTypes.BOOLEAN` appears character-identically in 2 files — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/DefaultEncodingFactory.java, core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.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 core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java:161 — `dataType == DataTypes.BYTE_ARRAY || dataType == DataTypes.BINARY` appears character-identically in 2 files — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java, core/src/main/java/org/apache/carbondata/core/metadata/datatype/DataType.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 core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:172 — `dataType == DataTypes.DATE || dataType == DataTypes.TIMESTAMP` appears character-identically in 3 files — core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java, core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java, core/src/main/java/org/apache/carbondata/core/util/comparator/Comparator.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 core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/DefaultEncodingFactory.java:124 — `dataType == DataTypes.FLOAT || dataType == DataTypes.DOUBLE` appears character-identically in 2 files — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/DefaultEncodingFactory.java, core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/EncodingFactory.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 core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java:94 — `dataType == DataTypes.INT || dataType == DataTypes.DATE` appears character-identically in 4 files — core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java, integration/presto/src/main/java/org/apache/carbondata/presto/CarbonVectorBatch.java, integration/presto/src/main/prestodb/org/apache/carbondata/presto/readers/ComplexTypeStreamReader.java, integration/presto/src/main/prestosql/org/apache/carbondata/presto/readers/ComplexTypeStreamReader.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 core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java:130 — `dataType == DataTypes.LONG || dataType == DataTypes.TIMESTAMP` appears character-identically in 10 files — core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageEncoderMeta.java, core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/DefaultEncodingFactory.java, core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java, core/src/main/java/org/apache/carbondata/core/scan/collector/impl/RestructureBasedVectorResultCollector.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.
AX6 · Interface segregation · Fat interface · ×6
  • Fat interface: GenericDataType<T> (17 abstract methods) processing/src/main/java/org/apache/carbondata/processing/datatypes/GenericDataType.java:35 — `GenericDataType<T>` declares 17 abstract methods: `addChildren`, `deepCopy`, `getAllPrimitiveChildren`, `getColsCount`, `getColumnNames`, `getColumnarDataForComplexType`, `getComplexColumnInfo`, `getDataCounter`, `getDepth`, `getIsColumnDictionary`, `getMaxOutputArrayIndex`, `getName`, `getParentName`, `parseComplexValue`, `setOutputArrayIndex`, `setSurrogateIndex`, `writeByteArray`. 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: Compressor (23 abstract methods) core/src/main/java/org/apache/carbondata/core/datastore/compression/Compressor.java:23 — `Compressor` declares 23 abstract methods: `compressByte`, `compressByte`, `compressByte`, `compressDouble`, `compressFloat`, `compressInt`, `compressLong`, `compressShort`, `getName`, `maxCompressedLength`, `rawCompress`, `rawUncompress`, `rawUncompress`, `supportReusableBuffer`, `supportUnsafe`, `unCompressByte`, `unCompressByte`, `unCompressDouble`, `unCompressFloat`, `unCompressInt`, `unCompressLong`, `unCompressShort`, `unCompressedLength`. 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 23 declarations carry 19 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 19 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: CarbonFile (42 abstract methods) core/src/main/java/org/apache/carbondata/core/datastore/filesystem/CarbonFile.java:28 — `CarbonFile` declares 42 abstract methods: `createNewFile`, `createNewFile`, `createNewLockFile`, `delete`, `deleteFile`, `exists`, `getAbsolutePath`, `getCanonicalPath`, `getDataInputStream`, `getDataInputStream`, `getDataInputStream`, `getDataOutputStream`, `getDataOutputStream`, `getDataOutputStream`, `getDataOutputStream`, `getDataOutputStream`, `getDataOutputStreamUsingAppend`, `getDefaultReplication`, `getLastModifiedTime`, `getLength`, `getLocations`, `getName`, `getParentFile`, `getPath`, `getSize`, `isDirectory`, `isFileExist`, `isFileExist`, `isFileModified`, `listDirs`, `listFiles`, `listFiles`, `listFiles`, `listFiles`, `listFiles`, `locationAwareListFiles`, `mkdirs`, `renameForce`, `renameTo`, `setLastModifiedTime`, and 2 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 42 declarations carry 30 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 30 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: ColumnPageValueConverter (16 abstract methods) core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPageValueConverter.java:26 — `ColumnPageValueConverter` declares 16 abstract methods under just 4 distinct name(s): `decodeAndFillVector`, `decodeDouble`, `decodeDouble`, `decodeDouble`, `decodeDouble`, `decodeDouble`, `decodeDouble`, `decodeLong`, `decodeLong`, `decodeLong`, `encode`, `encode`, `encode`, `encode`, `encode`, `encode`. 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. That is an OVERLOAD SET, not 16 separate responsibilities: a caller binds to 4 operation(s) and uses the overload it selected, so the Interface-Segregation harm does NOT apply on the caller's side and splitting this into role-interfaces would scatter one operation without relieving anything. The burden that does remain is the IMPLEMENTER's — all 16 signatures must be written and kept in step. Reduce it by collapsing overloads (optional or default parameters, or an options object) rather than by segregating the interface.
  • Fat interface: CarbonColumnVector (41 abstract methods) core/src/main/java/org/apache/carbondata/core/scan/result/vector/CarbonColumnVector.java:27 — `CarbonColumnVector` declares 41 abstract methods: `getBlockDataType`, `getData`, `getDictionaryVector`, `getType`, `hasDictionary`, `isNull`, `putAllByteArray`, `putArray`, `putBoolean`, `putByte`, `putByteArray`, `putByteArray`, `putByteArray`, `putBytes`, `putDecimal`, `putDecimals`, `putDouble`, `putDoubles`, `putDoubles`, `putFloat`, `putFloats`, `putInt`, `putInts`, `putInts`, `putLong`, `putLongs`, `putLongs`, `putNotNull`, `putNotNull`, `putNull`, `putNulls`, `putObject`, `putShort`, `putShorts`, `putShorts`, `reset`, `setBlockDataType`, `setCarbonDataFileWrittenVersion`, `setDictionary`, `setFilteredRowsExist`, and 1 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 41 declarations carry 34 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 34 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: CarbonMetaStore (20 abstract members) integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonMetaStore.scala:35 — `CarbonMetaStore` declares 20 abstract members: `lookupRelation`, `lookupRelation`, `lookupAnyRelation`, `createCarbonRelation`, `tableExists`, `tableExists`, `updateTableSchemaForAlter`, `updateTableSchema`, `revertTableSchemaInAlterFailure`, `saveToDisk`, `generateTableSchemaString`, `removeTableFromMetadata`, `updateMetadataByThriftTable`, `isTablePathExists`, `dropTable`, `isSchemaRefreshed`, `isReadFromHiveMetaStore`, `listAllTables`, `getThriftTableInfo`, `createCarbonDataSourceHadoopRelation`. Counted over its ABSTRACT members — a `def` with no body or a `val`/`var` with no initializer, once per signature; concrete members, private and protected members, and members of a companion `object` are not counted, because no implementer is forced to write them. Those 20 declarations carry 18 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 18 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.
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file REDACTED:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure core/src/main/java/org/apache/carbondata/core/scan/expression/ExpressionResult.java:570 — `compareTo` returns `-1` when `ParseException | FilterIllegalMemberException` 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 core/src/main/java/org/apache/carbondata/core/scan/filter/FilterUtil.java:855 — `compareFilterKeyBasedOnDataType` returns `-1` when `ParseException | 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.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 2 significant file(s) lose their only recent owner: core/src/main/java/org/apache/carbondata/core/index/IndexInputFormat.java, core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java. Pair on, review, or document these before any departure.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example README.md:1 — the repository holds project manifests and neither `README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 3 of 19 project(s) overshoot their size bounds, lowering Project Cohesion to 6.8/10. The most over is `core` (97548 LoC, 633 module-visible types across 125 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.
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Concentrated knowledge decay · ×1
  • Concentrated knowledge decay — 924 of 936 significant files have no living knowledge, while the repository is still being changed at a low rate (4 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 924 separate risks. Counted over 936 of the 1405 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D9 · Test Distribution · Inverted test pyramid · ×1
  • Inverted test pyramid — Only 13 % of tests are unit tests (1332 unit vs 8647 integration, 0 BDD); a broader unit base gives faster, more localised feedback.
M2 · Architecture documentation · No ADRs · ×1
  • 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.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 13/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `Agent_module`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X5 · Nullable reference types · Nullable reference types not enabled everywhere · ×1
  • Nullable reference types not enabled everywhere — 0/1 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
Minor — 7 finding(s)
D10 · Test Quality · Skipped (documented) · ×6
  • Skipped (documented): testCreateHashID geo/src/test/java/org/apache/carbondata/geo/QuadTreeClsTest.java:119 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testGetRange geo/src/test/java/org/apache/carbondata/geo/QuadTreeClsTest.java:296 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testInsertBiggerPolygon geo/src/test/java/org/apache/carbondata/geo/QuadTreeClsTest.java:86 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testInsertLessThan3Points geo/src/test/java/org/apache/carbondata/geo/QuadTreeClsTest.java:104 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testInsertPolygonFullRange geo/src/test/java/org/apache/carbondata/geo/QuadTreeClsTest.java:67 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testQueryOne geo/src/test/java/org/apache/carbondata/geo/QuadTreeClsTest.java:171 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: carbondata-common — carbondata-common: abstractness 0.24, instability 0.00, distance 0.76 — 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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-0cc471adf14e45d1a062463b26007a4c/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-0cc471adf14e45d1a062463b26007a4c/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .45artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .45artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .2artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—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.0—
D37 · Vulnerability-disclosure Policydisclosure—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.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1774c-6a00-70f1-97db-e6becbf8a16a · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md