Skip to content

Improve performance of listTemplates API - #13566

Open
Pearl1594 wants to merge 10 commits into
4.22from
improve-listtemplates-perf
Open

Pearl1594 wants to merge 10 commits into
4.22from
improve-listtemplates-perf

honor arch, osCategory, extension, imageStore and domain/isrecursive …

6c382bf
Select commit
Loading
Failed to load commit list.
SonarQubeCloud / SonarCloud Code Analysis failed Oct 8, 2026 in 7m 56s

Quality Gate failed

Annotations

Check warning on line 157 in server/src/main/java/com/cloud/api/query/dao/TemplateListFilter.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace this if-then-else statement by a single return statement.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYgZ63SXD0lZATpJ&open=AaEciYgZ63SXD0lZATpJ&pullRequest=13566

Check failure on line 141 in server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "template_dc_pair_dcid" 3 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYcs63SXD0lZATpH&open=AaEciYcs63SXD0lZATpH&pullRequest=13566

Check warning on line 5323 in server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use a primitive boolean expression here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYl363SXD0lZATpK&open=AaEciYl363SXD0lZATpK&pullRequest=13566

Check warning on line 5357 in server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Method has 31 parameters, which is greater than 7 authorized.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYl363SXD0lZATpL&open=AaEciYl363SXD0lZATpL&pullRequest=13566

Check warning on line 821 in server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use a primitive boolean expression here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYcs63SXD0lZATpC&open=AaEciYcs63SXD0lZATpC&pullRequest=13566

Check warning on line 5423 in server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use a stream instead of this loop.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYl363SXD0lZATpN&open=AaEciYl363SXD0lZATpN&pullRequest=13566

Check warning on line 844 in server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use a primitive boolean expression here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYcs63SXD0lZATpE&open=AaEciYcs63SXD0lZATpE&pullRequest=13566

Check warning on line 849 in server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use a primitive boolean expression here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYcs63SXD0lZATpF&open=AaEciYcs63SXD0lZATpF&pullRequest=13566

Check warning on line 394 in server/src/test/java/com/cloud/api/query/dao/TemplateJoinDaoImplBypassExplainTest.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYnF63SXD0lZATpO&open=AaEciYnF63SXD0lZATpO&pullRequest=13566

Check failure on line 140 in server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "template_dc_pair_templateid" 4 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYcs63SXD0lZATpG&open=AaEciYcs63SXD0lZATpG&pullRequest=13566

Check failure on line 5357 in server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 36 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYl363SXD0lZATpM&open=AaEciYl363SXD0lZATpM&pullRequest=13566

Check failure on line 114 in api/src/main/java/org/apache/cloudstack/query/QueryService.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "false" 3 times.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYXF63SXD0lZATpA&open=AaEciYXF63SXD0lZATpA&pullRequest=13566

Check warning on line 816 in server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use a primitive boolean expression here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYcs63SXD0lZATpB&open=AaEciYcs63SXD0lZATpB&pullRequest=13566

Check failure on line 777 in server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 56 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYcs63SXD0lZATpI&open=AaEciYcs63SXD0lZATpI&pullRequest=13566

Check warning on line 826 in server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use a primitive boolean expression here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaEciYcs63SXD0lZATpD&open=AaEciYcs63SXD0lZATpD&pullRequest=13566