Skip to content

[refactor] Convert switches to switch expressions per review

0f93f1d
Select commit
Loading
Failed to load commit list.
Open

Implement XQuery 4.0 parser with version gating and feature flag #6216

[refactor] Convert switches to switch expressions per review
0f93f1d
Select commit
Loading
Failed to load commit list.
Codacy Production / Codacy Static Code Analysis required action Apr 29, 2026 in 0s

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

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

Issues
======
- Added 25
           

Complexity increasing per file
==============================
- exist-core/src/test/java/org/exist/xquery/ReservedKeywordsAsNCNamesTest.java  10
- exist-core/src/main/java/org/exist/xquery/FocusFunction.java  13
- exist-core/src/main/java/org/exist/xquery/EnumCastExpression.java  25
- exist-core/src/main/java/org/exist/xquery/OtherwiseExpression.java  11
- exist-core/src/main/java/org/exist/xquery/MethodCallOperator.java  31
- exist-core/src/main/java/org/exist/xquery/PipelineExpression.java  10
- exist-core/src/main/java/org/exist/xquery/ForKeyValueExpr.java  50
- exist-core/src/main/java/org/exist/xquery/ForMemberExpr.java  35
- exist-core/src/main/java/org/exist/xquery/ChoiceCastableExpression.java  18
- exist-core/src/main/java/org/exist/xquery/FilterExprAM.java  30
- exist-core/src/main/java/org/exist/xquery/MappingArrowOperator.java  31
- exist-core/src/main/java/org/exist/xquery/LetDestructureExpr.java  68
- exist-core/src/main/java/org/exist/xquery/KeywordArgumentExpression.java  8
- exist-core/src/test/java/org/exist/xquery/ReservedFunctionNameTest.java  4
- exist-core/src/main/java/org/exist/xquery/WhileClause.java  14
- exist-core/src/main/java/org/exist/xquery/ChoiceCastExpression.java  19
         

See the complete overview on Codacy

Annotations

Check warning on line 75 in exist-core/src/main/java/org/exist/xquery/FilterExprAM.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/FilterExprAM.java#L75

Avoid reassigning parameters such as 'contextSequence'

Check warning on line 102 in exist-core/src/main/java/org/exist/xquery/ForKeyValueExpr.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/ForKeyValueExpr.java#L102

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

Check warning on line 83 in exist-core/src/main/java/org/exist/xquery/ForMemberExpr.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/ForMemberExpr.java#L83

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

Check warning on line 419 in exist-core/src/main/java/org/exist/xquery/FunctionFactory.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/FunctionFactory.java#L419

Use equals() to compare object references.

Check warning on line 603 in exist-core/src/main/java/org/exist/xquery/FunctionFactory.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/FunctionFactory.java#L603

The method 'resolveKeywordArguments(XQueryContext, List, FunctionSignature, XQueryAST)' has an NPath complexity of 9840, current threshold is 200

Check warning on line 116 in exist-core/src/main/java/org/exist/xquery/LetDestructureExpr.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/LetDestructureExpr.java#L116

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

Check warning on line 91 in exist-core/src/main/java/org/exist/xquery/MappingArrowOperator.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/MappingArrowOperator.java#L91

Avoid reassigning parameters such as 'contextSequence'

Check warning on line 78 in exist-core/src/main/java/org/exist/xquery/MethodCallOperator.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/MethodCallOperator.java#L78

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

Check warning on line 80 in exist-core/src/main/java/org/exist/xquery/MethodCallOperator.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/MethodCallOperator.java#L80

Avoid reassigning parameters such as 'contextSequence'

Check warning on line 53 in exist-core/src/main/java/org/exist/xquery/OtherwiseExpression.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/OtherwiseExpression.java#L53

Avoid reassigning parameters such as 'contextSequence'

Check warning on line 55 in exist-core/src/main/java/org/exist/xquery/PipelineExpression.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/PipelineExpression.java#L55

Avoid reassigning parameters such as 'contextSequence'

Check notice on line 59 in exist-core/src/main/java/org/exist/xquery/SwitchExpression.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/SwitchExpression.java#L59

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Check warning on line 166 in exist-core/src/main/java/org/exist/xquery/TryCatchExpression.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/TryCatchExpression.java#L166

An instanceof check is being performed on the caught exception.  Create a separate catch clause for this exception type.

Check notice on line 165 in exist-core/src/main/java/org/exist/xquery/value/SequenceType.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/value/SequenceType.java#L165

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Check notice on line 166 in exist-core/src/main/java/org/exist/xquery/value/SequenceType.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/value/SequenceType.java#L166

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Check warning on line 229 in exist-core/src/main/java/org/exist/xquery/value/SequenceType.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/value/SequenceType.java#L229

The method 'checkType(Item)' has an NPath complexity of 24480, current threshold is 200

Check notice on line 296 in exist-core/src/main/java/org/exist/xquery/value/SequenceType.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/value/SequenceType.java#L296

These nested if statements could be combined

Check warning on line 314 in exist-core/src/main/java/org/exist/xquery/value/SequenceType.java

See this annotation in the file changed.

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

exist-core/src/main/java/org/exist/xquery/value/SequenceType.java#L314

The method 'checkRecordType(Item)' has an NPath complexity of 8064, current threshold is 200

Check notice on line 44 in exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java

See this annotation in the file changed.

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

exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java#L44

The class name 'ParserBenchmark' doesn't match '^Test.*$|^[A-Z][a-zA-Z0-9]*Test(s|Case)?$'

Check warning on line 157 in exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java

See this annotation in the file changed.

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

exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java#L157

Avoid throwing raw exception types.

Check warning on line 171 in exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java

See this annotation in the file changed.

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

exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java#L171

Avoid throwing raw exception types.

Check warning on line 186 in exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java

See this annotation in the file changed.

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

exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java#L186

Avoid throwing raw exception types.

Check warning on line 203 in exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java

See this annotation in the file changed.

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

exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java#L203

JUnit tests should include assert() or fail()

Check warning on line 215 in exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java

See this annotation in the file changed.

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

exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java#L215

JUnit tests should include assert() or fail()

Check warning on line 258 in exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java

See this annotation in the file changed.

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

exist-core/src/test/java/org/exist/xquery/parser/ParserBenchmark.java#L258

Avoid unused local variables such as 'astTemplate'.