Skip to content

[refactor] Address Codacy findings in lock package

a581a85
Select commit
Loading
Failed to load commit list.
Draft

Preclaiming two-phase locking for XQuery update operations #6112

[refactor] Address Codacy findings in lock package
a581a85
Select commit
Loading
Failed to load commit list.
Codacy Production / Codacy Static Code Analysis required action May 10, 2026 in 0s

31 new issues (0 max.) of at least severity.

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 31
           

Complexity increasing per file
==============================
- exist-core/src/main/java/org/exist/xquery/FunctionCall.java  6
- exist-core/src/main/java/org/exist/xquery/PathExpr.java  7
- exist-core/src/main/java/org/exist/dom/memtree/ElementImpl.java  8
- exist-core/src/main/java/org/exist/dom/memtree/NodeImpl.java  2
- exist-core/src/main/java/org/exist/xquery/XQuery.java  4
- exist-core/src/main/java/org/exist/xquery/AbstractFLWORClause.java  1
- exist-core/src/main/java/org/exist/xquery/lock/LockTargetCollector.java  58
- exist-core/src/test/java/org/exist/xquery/lock/ConcurrencyBenchmark.java  48
- exist-core/src/test/java/org/exist/xquery/lock/LockTargetCollectorTest.java  10
- exist-core/src/main/java/org/exist/xquery/xquf/XQUFFnPut.java  2
- exist-core/src/test/java/org/exist/xquery/xquf/XQUFBenchmark.java  42
- exist-core/src/main/java/org/exist/xquery/xquf/XQUFRenameExpr.java  29
- exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java  333
- exist-core/src/main/java/org/exist/xquery/xquf/XQUFReplaceValueExpr.java  23
- exist-core/src/main/java/org/exist/xquery/xquf/XQUFTransformExpr.java  52
- exist-core/src/main/java/org/exist/xquery/xquf/XQUFInsertExpr.java  75
- exist-core/src/main/java/org/exist/xquery/xquf/XQUFDeleteExpr.java  16
- exist-core/src/main/java/org/exist/xquery/xquf/XQUFReplaceNodeExpr.java  31
- exist-core/src/main/java/org/exist/xquery/xquf/UpdatePrimitive.java  18
- exist-core/src/test/java/org/exist/xquery/xquf/XQUFBasicTest.java  118
- exist-core/src/main/java/org/exist/xquery/XQueryContext.java  23
         

See the complete overview on Codacy

Annotations

Check warning on line 1816 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L1816

The method 'replaceValue(int, String)' has an NPath complexity of 3051, current threshold is 200

Check notice on line 1926 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L1926

Unnecessary use of fully qualified name 'org.exist.xquery.XPathException' due to existing import 'org.exist.xquery.XPathException'

Check warning on line 2100 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L2100

The method 'mergeAdjacentTextNodes()' has an NPath complexity of 2666, current threshold is 200

Check warning on line 2198 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L2198

The method 'insertChildren(int, Sequence, boolean)' has an NPath complexity of 378, current threshold is 200

Check warning on line 2283 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L2283

The method 'insertSiblings(int, Sequence, boolean)' has an NPath complexity of 876, current threshold is 200

Check warning on line 2370 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L2370

The method 'insertAttributes(int, Sequence, boolean)' has an NPath complexity of 177408, current threshold is 200

Check notice on line 2380 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L2380

Unnecessary use of fully qualified name 'org.exist.xquery.value.Type.NODE' due to existing import 'org.exist.xquery.value.Type'

Check warning on line 2484 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L2484

The method 'replaceNode(int, Sequence)' has an NPath complexity of 4410, current threshold is 200

Check warning on line 2615 in exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/dom/memtree/DocumentImpl.java#L2615

The method 'copyNodeIntoDocument(Node, int, short, Map)' has an NPath complexity of 82950, current threshold is 200

Check notice on line 468 in exist-core/src/main/java/org/exist/xquery/XQuery.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/XQuery.java#L468

Unnecessary use of fully qualified name 'org.exist.xquery.xquf.PendingUpdateList' due to existing same package import 'org.exist.xquery.*'

Check notice on line 1428 in exist-core/src/main/java/org/exist/xquery/XQueryContext.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/XQueryContext.java#L1428

Unnecessary use of fully qualified name 'org.exist.xquery.lock.LockTargetCollector' due to existing same package import 'org.exist.xquery.*'

Check notice on line 1429 in exist-core/src/main/java/org/exist/xquery/XQueryContext.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/XQueryContext.java#L1429

Unnecessary use of fully qualified name 'org.exist.xquery.lock.LockTargetCollector' due to existing same package import 'org.exist.xquery.*'

Check warning on line 192 in exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java#L192

Use equals() to compare object references.

Check warning on line 279 in exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java#L279

The method 'checkAttributeAndNamespaceConflicts()' has an NPath complexity of 564510, current threshold is 200

Check warning on line 722 in exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java#L722

The method 'applyInMemory(List)' has an NPath complexity of 4377600, current threshold is 200

Check warning on line 1067 in exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/PendingUpdateList.java#L1067

The method 'applyPersistent(XQueryContext, List)' has an NPath complexity of 1728039, current threshold is 200

Check warning on line 73 in exist-core/src/main/java/org/exist/xquery/xquf/XQUFInsertExpr.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/XQUFInsertExpr.java#L73

The method 'eval(Sequence, Item)' has an NPath complexity of 6649344, current threshold is 200

Check warning on line 113 in exist-core/src/main/java/org/exist/xquery/xquf/XQUFInsertExpr.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/XQUFInsertExpr.java#L113

Switch statements should be exhaustive, add a default case (or missing enum branches)

Check warning on line 64 in exist-core/src/main/java/org/exist/xquery/xquf/XQUFRenameExpr.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/XQUFRenameExpr.java#L64

The method 'eval(Sequence, Item)' has an NPath complexity of 32256, current threshold is 200

Check notice on line 123 in exist-core/src/main/java/org/exist/xquery/xquf/XQUFRenameExpr.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/XQUFRenameExpr.java#L123

Unnecessary use of fully qualified name 'org.exist.dom.QName.isQName' due to existing import 'org.exist.dom.QName'

Check warning on line 65 in exist-core/src/main/java/org/exist/xquery/xquf/XQUFReplaceNodeExpr.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/XQUFReplaceNodeExpr.java#L65

The method 'eval(Sequence, Item)' has an NPath complexity of 18432, current threshold is 200

Check warning on line 63 in exist-core/src/main/java/org/exist/xquery/xquf/XQUFReplaceValueExpr.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/XQUFReplaceValueExpr.java#L63

The method 'eval(Sequence, Item)' has an NPath complexity of 384, current threshold is 200

Check warning on line 196 in exist-core/src/main/java/org/exist/xquery/xquf/XQUFTransformExpr.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/main/java/org/exist/xquery/xquf/XQUFTransformExpr.java#L196

The method 'deepCopyNode(Sequence)' has an NPath complexity of 968, current threshold is 200

Check warning on line 112 in exist-core/src/test/java/org/exist/xquery/lock/ConcurrencyBenchmark.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/test/java/org/exist/xquery/lock/ConcurrencyBenchmark.java#L112

JUnit tests should include assert() or fail()

Check warning on line 135 in exist-core/src/test/java/org/exist/xquery/lock/ConcurrencyBenchmark.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

exist-core/src/test/java/org/exist/xquery/lock/ConcurrencyBenchmark.java#L135

JUnit tests should include assert() or fail()