Three-Tiered Ratings

Issues identified by code quality testing are assigned to one of three categories.

  • Critical - Issues that cause an immediate failure of the pipeline.

  • Important - Issues that cause the pipeline to enter a paused state. A deployment manager, project manager, or business lead can either override the issues, allowing the pipeline to proceed. Alternatively, they can accept the issues, causing the pipeline to stop with a failure.

  • Info - Issues that are provided purely for informational purposes and have no impact on the pipeline execution

NOTE
In a code quality only pipeline, important failures in the Code Quality gate cannot be overridden since the code quality testing step is the final step in the pipeline.

Ratings

The results of this step are delivered as Ratings.

The following table summarizes the ratings and failure thresholds for each of the critical, important, and information categories.

NameDefinitionCategoryFailure Threshold
Security RatingA = No vulnerabilities
B = At least 1 minor vulnerability
C = At least 1 major vulnerability
D = At least 1 critical vulnerability
E = At least 1 blocker vulnerability
Critical< B
Reliability RatingA = No bugs
B = At least 1 minor bug
C = At least 1 major bug
D = At least 1 critical bug
E = At least 1 blocker bug
Critical< D
Maintainability Rating

Defined by the outstanding remediation cost for code smells as a percentage of the time that has already gone into the application

  • A = <=5%
  • B = 6-10%
  • C = 11-20%
  • D = 21-50%
  • E = >50%
Important< A
Coverage

Defined by a mix of unit test line coverage and condition coverage using the formula:
Coverage = (CT + CF + LC)/(2*B + EL)

  • CT = Conditions that have been evaluated as true at least once while running unit tests
  • CF = Conditions that have been evaluated as false at least once while running unit tests
  • LC = Covered lines = lines_to_cover - uncovered_lines
  • B = total number of conditions
  • EL = total number of executable lines (lines_to_cover)
Important< 50%
Skipped Unit TestsNumber of skipped unit testsInfo> 1
Open IssuesOverall issue types - Vulnerabilities, Bugs, and Code SmellsInfo> 0
Duplicated Lines

Defined as the number of lines involved in duplicated blocks. A block of code is considered duplicated under the following conditions.
Non-Java Projects:

  • There should be at least 100 successive and duplicated tokens.
  • Those tokens should be spread over at least:
  • 30 lines of code for COBOL
  • 20 lines of code for ABAP
  • 10 lines of code for other languages

Java Projects:

  • There should be at least 10 successive and duplicated statements regardless of the number of tokens and lines.

Differences in indentation and in string literals are ignored when detecting duplicates.

Info> 1%
Cloud Service CompatibilityNumber of identified cloud service compatibility issuesInfo> 0
NOTE
See SonarQube’s Metric Definitions for more detailed definitions.
NOTE
To learn more about the custom code quality rules run by Cloud Manager, see Custom Code Quality Rules.

Dealing with False Positives

The quality scanning process is not error-free and sometimes identifies issues that are not actual defects. This state is called a false positive.

In these cases, the source code can be annotated with the standard Java @SuppressWarnings annotation specifying the rule ID as the annotation attribute. For example, one common false positive is that the SonarQube rule to detect hardcoded passwords can be overly restrictive about how a hardcoded password is identified.

The following code is fairly common in an AEM project, which has code to connect to some external service.

@Property(label = "Service Password")
private static final String PROP_SERVICE_PASSWORD = "password";

SonarQube raises a blocker vulnerability. But after reviewing the code, you recognize that this issue is not a vulnerability and can annotate the code with the appropriate rule ID.

@SuppressWarnings("squid:S2068")
@Property(label = "Service Password")
private static final String PROP_SERVICE_PASSWORD = "password";

If the code was the following:

@Property(label = "Service Password", value = "mysecretpassword")
private static final String PROP_SERVICE_PASSWORD = "password";

Then the correct solution is to remove the hardcoded password.

NOTE
While it is best practice to make the @SuppressWarnings annotation specific, you can also annotate at the class level.
NOTE
While there is no explicit security testing step, there are security-related code quality rules evaluated during the code quality step. To learn more about security in Cloud Service, see Security Overview for AEM as a Cloud Service.

Content Package Scanning Optimization

As part of the quality analysis process, Cloud Manager performs analysis of the content packages produced by the Maven build. Cloud Manager offers optimizations to accelerate this process, which is effective when certain packaging constraints are observed. The most significant optimization targets projects producing a single “all” package. This package contains multiple content packages from the build that are marked as skipped. When Cloud Manager detects this scenario, rather than unpack the “all” package, the individual content packages are scanned directly and sorted based on dependencies. For example, consider the following build output.

  • all/myco-all-1.0.0-SNAPSHOT.zip (content-package)
  • ui.apps/myco-ui.apps-1.0.0-SNAPSHOT.zip (skipped-content-package)
  • ui.content/myco-ui.content-1.0.0-SNAPSHOT.zip (skipped-content-package)

If the only items inside myco-all-1.0.0-SNAPSHOT.zip are the two skipped content packages, then the two embedded packages are scanned in lieu of the “all” content package.

For projects that produce dozens of embedded packages, this optimization has been shown to save more than 10 minutes per pipeline execution.

A special case can occur when the “all” content package contains a combination of skipped content packages and OSGi bundles. For example, if myco-all-1.0.0-SNAPSHOT.zip contained the two mentioned embedded packages and OSGi bundles, a new, minimal content package is constructed with only the OSGi bundles. This package is always named cloudmanager-synthetic-jar-package and the contained bundles are placed in /apps/cloudmanager-synthetic-installer/install.

NOTE
  • This optimization does not impact the packages which are deployed to AEM.
  • The matching between embedded content packages and skipped content packages relies on file names. This optimization cannot occur if multiple skipped packages share the same file name or if the file name changes during embedding.

Announcements

Get hands-on with agentic AI.

Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.

Find an event

Ask AI

Not sure where to start?
Ask me anything about Adobe products.

Type your question or pick a suggestion below.

Use of this AI chatbot is subject to Adobe's Privacy Policy. Don't share sensitive data. AI responses are not your Content, may be inaccurate, and any offers provided are non-binding. Generative AI Terms.

Ask AI