Surface code coverage metrics from SonarQube in failed Scorecard rules
CQL captures allow you to extract specific values from entity data when a rule fails, making it easier for engineers to understand what went wrong. A typical use of captures is to show key quality metrics, such as code coverage, or detailed data like vulnerabilities in Scorecard rule failure messages. This helps engineers quickly understand why a rule is failing for an entity.
Capturing code coverage from SonarQube
You can use captures to surface quality metrics such as code coverage from third-party integrations like SonarQube.
Decide what data to show in the failure message. In this example, we want to display the code coverage metric reported by SonarQube.
While configuring a Scorecard, add a rule using a CQL capture. Use a CQL expression to capture the code coverage metric and apply a threshold: captures("code-cov", sonarqube.metric("coverage")) > 50
Customize the rule’s Failure message field to include the captured value. This message will appear when the rule fails (i.e., when coverage is 50% or lower):
This entity's code coverage metric from Sonarqube is:{{context.evaluation.captures.code-cov}}%
After evaluation, view the Scorecard details. Navigate to the entity that failed the rule. Expand the failure message to view the captured code coverage value.
Last modified on September 28, 2026
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Cortex","colors":{"primary":"#653EE8","light":"#9378EF","dark":"#5132BA"},"logo":{"light":"https://mintcdn.com/cortex-290c0c42/JcmXgfdiEzZzqS2M/logo/cortex-light.svg?fit=max\u0026auto=format\u0026n=JcmXgfdiEzZzqS2M\u0026q=85\u0026s=3d32dd91336a0de9463a57e04f9b8bb3","dark":"https://mintcdn.com/cortex-290c0c42/JcmXgfdiEzZzqS2M/logo/cortex-dark.svg?fit=max\u0026auto=format\u0026n=JcmXgfdiEzZzqS2M\u0026q=85\u0026s=e664b364295c3625385d56e02110b4a7"},"favicon":{"light":"https://mintcdn.com/cortex-290c0c42/09VjkT_e7zMKfZOT/images/favicon.png?fit=max\u0026auto=format\u0026n=09VjkT_e7zMKfZOT\u0026q=85\u0026s=1689c84dea2d7ff7c17603f1d27163ae","dark":"https://mintcdn.com/cortex-290c0c42/09VjkT_e7zMKfZOT/images/favicon.png?fit=max\u0026auto=format\u0026n=09VjkT_e7zMKfZOT\u0026q=85\u0026s=1689c84dea2d7ff7c17603f1d27163ae"},"api":{"playground":{"display":"interactive"},"examples":{"prefill":true}},"appearance":{"default":"system"},"background":{"decoration":"gradient"},"navbar":{"links":[{"icon":"/images/us-flag.png","href":"https://app.getcortexapp.com/","label":"US"},{"icon":"/images/eu-flag.png","href":"https://app.eu.cortex.io/","label":"EU"}],"primary":{"type":"button","label":"Get a Demo","href":"https://www.cortex.io/demo"}},"footer":{"socials":{"github":"https://github.com/cortexapps","linkedin":"https://www.linkedin.com/company/cortexapp","youtube":"https://www.youtube.com/@cortex611","x":"https://twitter.com/GetCortexApp"},"links":[{"header":"Cortex","items":[{"label":"Cortex website","href":"https://cortex.io"},{"label":"Product log in (US)","href":"https://app.getcortexapp.com/login"},{"label":"Product log in (EU)","href":"https://app.eu.cortex.io/login"},{"label":"Privacy Policy","href":"https://www.cortex.io/legal/privacy-policy"},{"label":"Security Policy","href":"https://www.cortex.io/legal/security-policy"},{"label":"Terms of Service","href":"https://www.cortex.io/legal/terms-of-service"},{"label":"Status Page","href":"https://status.cortex.io/"}]},{"header":"Resources","items":[{"label":"Cortex Academy","href":"https://academy.cortex.io/"},{"label":"Blog","href":"https://www.cortex.io/blog"},{"label":"Engineering Blog","href":"https://builders.cortex.io/"},{"label":"Braintrust","href":"https://www.braintrust.cortex.io/"},{"label":"Contact Support","href":"https://support.cortex.io/"}]}]},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"icons":{"library":"fontawesome"},"styling":{"eyebrows":"breadcrumbs","latex":false},"contextual":{"options":["copy","view","chatgpt","claude","download-pdf"],"display":"header"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cortex-290c0c42","hasAudioNarration":false,"actualSubdomain":"cortex-290c0c42","customDomains":["docs.cortex.io"],"gitSource":{"type":"github","owner":"cortexapps","repo":"brainpower","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0466ce839604291956a9f8","clientVersion":"0.0.4304","searchFilterCounts":[{"language":"default","tag":"API Reference","count":664},{"language":"default","tag":"REST API operations","count":663},{"language":"default","tag":"Integrations","count":490},{"language":"default","tag":"Product Docs","count":240},{"language":"default","tag":"Connect data","count":125},{"language":"default","tag":"Cookbooks","count":51},{"language":"default","tag":"Product areas","count":50},{"language":"default","tag":"Workflows","count":47},{"language":"default","tag":"Entities overview","count":38},{"language":"default","tag":"Configure","count":37}],"searchSettings":{"showContentSnippets":true}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":where(img[src^=\"/images/\"]){display:block;margin-left:auto;margin-right:auto;max-width:100%;height:auto}#navbar li.navbar-link>a{background-color:rgb(3 7 18 / 0.06)}#navbar li.navbar-link>a:hover{background-color:rgb(3 7 18 / 0.12)}html.dark #navbar li.navbar-link>a{background-color:rgb(255 255 255 / 0.07)}html.dark #navbar li.navbar-link>a:hover{background-color:rgb(255 255 255 / 0.14)}#content-area .mdx-content{--tw-prose-links: #7458DB;--tw-prose-invert-links: #C0AFFF}html.dark #content-area .mdx-content :where(a):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)){color:#C0AFFF}.product-tab{background-color:#F3F4F6!important;color:#000!important}.product-tab[data-active=\"true\"]{background-color:#E6E7E9!important}html.dark .product-tab{background-color:rgb(255 255 255 / 0.1)!important;color:#fff!important}html.dark .product-tab[data-active=\"true\"]{background-color:#653EE8!important}.product-item[data-active=\"true\"]{background-color:#E6E7E9}html.dark .product-item[data-active=\"true\"]{background-color:rgb(255 255 255 / 0.05)}.product-item-arrow{opacity:0}.product-item-arrow svg{width:14px!important;height:14px!important;max-width:14px;max-height:14px;flex-shrink:0}.product-item-arrow[data-active=\"true\"]{opacity:1}#kapa-search-ask-row{display:flex;align-items:center;gap:0.5rem;margin:0 0.375rem 0.375rem;padding:0.625rem 0.75rem;border-top:1px solid rgb(229 231 235);background:transparent;font-size:0.875rem;font-weight:500;color:rgb(3 7 18);text-align:left;cursor:pointer}#kapa-search-ask-row[hidden]{display:none}#kapa-search-ask-row:hover{background:rgb(0 0 0 / 0.03)}#kapa-search-ask-row svg{width:1rem;height:1rem;flex-shrink:0;color:rgb(var(--primary))}#kapa-search-ask-row .kapa-search-ask-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#kapa-search-ask-row kbd{padding:0 0.3rem;border:1px solid rgb(229 231 235);border-radius:0.25rem;font-family:inherit;font-size:0.75rem;color:rgb(107 114 128)}.dark #kapa-search-ask-row{border-top-color:rgb(255 255 255 / 0.1);color:#fff}.dark #kapa-search-ask-row:hover{background:rgb(255 255 255 / 0.05)}.dark #kapa-search-ask-row svg{color:rgb(var(--primary-light))}.dark #kapa-search-ask-row kbd{border-color:rgb(255 255 255 / 0.1);color:rgb(156 163 175)}#assistant-entry,#assistant-entry-mobile{display:none!important}#kapa-ask-button{display:none;flex:none;align-items:center;gap:0.375rem;height:2.25rem;margin-left:0.5rem;padding:0 0.875rem 0 0.75rem;border-radius:9999px;background:rgb(3 7 18 / 0.03);font-size:0.875rem;font-weight:500;color:rgb(55 65 81);cursor:pointer}@media (min-width: 1024px){#kapa-ask-button{display:flex}}#kapa-ask-button:hover{background:rgb(3 7 18 / 0.1)}#kapa-ask-button svg{width:1rem;height:1rem;color:rgb(var(--primary))}html.dark #kapa-ask-button{background:rgb(255 255 255 / 0.03);color:rgb(209 213 219)}html.dark #kapa-ask-button:hover{background:rgb(255 255 255 / 0.1)}html.dark #kapa-ask-button svg{color:rgb(var(--primary-light))}"},{"filePath":"status-tags.css","content":".nav-tag-pill[data-status]{background-color:var(--status-tag-color)!important;border-color:var(--status-tag-color)!important}.nav-tag-pill[data-status],.nav-tag-pill[data-status] .nav-tag-pill-text{color:#FFFFFF!important}.nav-tag-pill[data-status=\"research-preview\"]{--status-tag-color: #7B2D6B}.nav-tag-pill[data-status=\"public-beta\"]{--status-tag-color: #1D4ED8}.nav-tag-pill[data-status=\"private-beta\"]{--status-tag-color: #8C1D3A}.nav-tag-pill[data-status]{white-space:nowrap;flex-shrink:0}"},{"filePath":"changelog-dates.css","content":"html[data-changelog-page] #changelog-filters{height:100%;min-height:0}html[data-changelog-page] #changelog-filters>#changelog-filters{display:flex;flex-direction:column;height:auto;max-height:100%;overflow:hidden}html[data-changelog-page] #changelog-filters>#changelog-filters>*{flex-shrink:0}#changelog-dates{flex:1 1 auto!important;flex-shrink:1!important;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0.5rem 0.25rem 1.5rem 0}#changelog-dates [hidden]{display:none!important}#changelog-dates .changelog-dates-toggle{display:flex;text-decoration:none;align-items:center;justify-content:space-between;width:100%;padding:0.375rem 0;font-weight:500;color:rgb(55 65 81);cursor:pointer}#changelog-dates .changelog-dates-toggle svg{width:0.875rem;height:0.875rem;transition:transform 150ms ease}#changelog-dates .changelog-dates-year[data-open] .changelog-dates-toggle svg{transform:rotate(90deg)}#changelog-dates .changelog-dates-list{display:none;list-style:none;margin:0.25rem 0 0.5rem;padding:0}#changelog-dates .changelog-dates-year[data-open] .changelog-dates-list{display:block}#changelog-dates .changelog-dates-list li{margin:0;padding:0}#changelog-dates .changelog-dates-list a{display:block;padding:0.25rem 0 0.25rem 1rem;border-left:1px solid rgb(3 7 18 / 0.05);color:rgb(75 85 99);text-decoration:none}#changelog-dates .changelog-dates-toggle:hover,#changelog-dates .changelog-dates-list a:hover{color:rgb(17 24 39)}#changelog-dates .changelog-dates-list a:hover{border-left-color:rgb(3 7 18 / 0.2)}#changelog-dates .changelog-dates-list li[data-active] a{color:rgb(var(--primary));border-left-color:rgb(var(--primary));font-weight:500}html.dark #changelog-dates .changelog-dates-toggle{color:rgb(209 213 219)}html.dark #changelog-dates .changelog-dates-list a{color:rgb(156 163 175);border-left-color:rgb(255 255 255 / 0.1)}html.dark #changelog-dates .changelog-dates-toggle:hover,html.dark #changelog-dates .changelog-dates-list a:hover{color:rgb(243 244 246)}html.dark #changelog-dates .changelog-dates-list a:hover{border-left-color:rgb(255 255 255 / 0.2)}html.dark #changelog-dates .changelog-dates-list li[data-active] a{color:rgb(var(--primary-light));border-left-color:rgb(var(--primary-light))}.update-container[data-untagged-hidden],h2[hidden]{display:none!important}"}]}
{"page":{"pagePath":"guides/security/code-coverage-rules","slug":"/guides/security/code-coverage-rules","pageMetadata":{"title":"Surface code coverage metrics from SonarQube in failed Scorecard rules","description":null,"href":"/guides/security/code-coverage-rules"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const RecipeBadges=({badges=[]})=>{const map={\"recipe\":{label:`Recipe`,color:`#A86400`},\"ai-excellence\":{label:`AI excellence`,color:`#653EE8`},\"production-readiness\":{label:`Production readiness`,color:`#226686`},\"incident-mgmt\":{label:`Incident management`,color:`#86198F`},\"migrations\":{label:`Migrations`,color:`#0E7C66`},\"compliance\":{label:`Compliance`,color:`#475569`},\"dora\":{label:`DORA metrics`,color:`#1D4ED8`},\"security\":{label:`Security`,color:`#B42318`},\"operational-readiness\":{label:`Operational readiness`,color:`#B54708`},\"dev-onboarding\":{label:`Developer onboarding`,color:`#C11574`}};const items=badges.map(key=>map[key]).filter(Boolean);if(items.length===0)return null;return _jsx(`div`,{className:`not-prose mint-flex mint-flex-wrap mint-gap-2 mint-mb-6`,children:items.map(b=>_jsx(`span`,{className:`mint-rounded-lg mint-px-2 mint-py-1 mint-text-xs mint-font-medium`,style:{backgroundColor:b.color,color:b.textColor||`#FFFFFF`},children:b.label},b.label))})};function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,OptimizedImage,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`RecipeBadges`,children:_jsx(RecipeBadges,{badges:[`recipe`,`security`]})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/standardize/cql#captures`,children:`CQL captures`}),` allow you to extract specific values from entity data when a rule fails, making it easier for engineers to understand what went wrong. A typical use of captures is to show key quality metrics, such as code coverage, or detailed data like vulnerabilities in Scorecard rule failure messages. This helps engineers quickly understand why a rule is failing for an entity.`]}),`\n`,_jsx(Heading,{level:`2`,id:`capturing-code-coverage-from-sonarqube`,children:`Capturing code coverage from SonarQube`}),`\n`,_jsx(_components.p,{children:`You can use captures to surface quality metrics such as code coverage from third-party integrations like SonarQube.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Decide what data to show in the failure message. In this example, we want to display the code coverage metric reported by SonarQube.`}),`\n`,_jsxs(_components.li,{children:[`While `,_jsx(_components.a,{href:`/standardize/scorecards/create#step-1-configure-the-basic-scorecard-fields`,children:`configuring a Scorecard`}),`, add a rule using a CQL capture. Use a CQL expression to capture the code coverage metric and apply a threshold:`,_jsx(`br`,{}),`\n`,_jsx(_components.code,{children:`captures(\"code-cov\", sonarqube.metric(\"coverage\")) > 50`})]}),`\n`,_jsxs(_components.li,{children:[`Customize the rule’s `,_jsx(_components.strong,{children:`Failure message`}),` field to include the captured value. This message will appear when the rule fails (i.e., when coverage is 50% or lower):`]}),`\n`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`This entity's code coverage metric from Sonarqube is:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`{{context.evaluation.captures.code-cov}}%`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ol,{start:`4`,children:[`\n`,_jsx(_components.li,{children:`After evaluation, view the Scorecard details. Navigate to the entity that failed the rule. Expand the failure message to view the captured code coverage value.`}),`\n`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/cortex-290c0c42/qRY2zZcIyXqFVeCq/guides/images/zight-2025-05-23-at-2-34-09-pm.jpg?fit=max\u0026auto=format\u0026n=qRY2zZcIyXqFVeCq\u0026q=85\u0026s=cb263e83d57be56ce094c524b2d10790`,alt:``,\"data-og-width\":`2234`,width:`2234`,\"data-og-height\":`1138`,height:`1138`,\"data-path\":`guides/images/zight-2025-05-23-at-2-34-09-pm.jpg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/cortex-290c0c42/qRY2zZcIyXqFVeCq/guides/images/zight-2025-05-23-at-2-34-09-pm.jpg?w=280\u0026fit=max\u0026auto=format\u0026n=qRY2zZcIyXqFVeCq\u0026q=85\u0026s=d4184e8c72c75e708a163ab6e7ff3ad9 280w, https://mintcdn.com/cortex-290c0c42/qRY2zZcIyXqFVeCq/guides/images/zight-2025-05-23-at-2-34-09-pm.jpg?w=560\u0026fit=max\u0026auto=format\u0026n=qRY2zZcIyXqFVeCq\u0026q=85\u0026s=b56e191a583d8ecb430869dc3a92c118 560w, https://mintcdn.com/cortex-290c0c42/qRY2zZcIyXqFVeCq/guides/images/zight-2025-05-23-at-2-34-09-pm.jpg?w=840\u0026fit=max\u0026auto=format\u0026n=qRY2zZcIyXqFVeCq\u0026q=85\u0026s=61c40925553ee904c61dc6b6314f3f94 840w, https://mintcdn.com/cortex-290c0c42/qRY2zZcIyXqFVeCq/guides/images/zight-2025-05-23-at-2-34-09-pm.jpg?w=1100\u0026fit=max\u0026auto=format\u0026n=qRY2zZcIyXqFVeCq\u0026q=85\u0026s=927cde2a9fc41c908774e9fa69911519 1100w, https://mintcdn.com/cortex-290c0c42/qRY2zZcIyXqFVeCq/guides/images/zight-2025-05-23-at-2-34-09-pm.jpg?w=1650\u0026fit=max\u0026auto=format\u0026n=qRY2zZcIyXqFVeCq\u0026q=85\u0026s=c4edd2d45dc75ed32962b2d32ec5d352 1650w, https://mintcdn.com/cortex-290c0c42/qRY2zZcIyXqFVeCq/guides/images/zight-2025-05-23-at-2-34-09-pm.jpg?w=2500\u0026fit=max\u0026auto=format\u0026n=qRY2zZcIyXqFVeCq\u0026q=85\u0026s=9430b3b825cd2f7f310bb7485b602df4 2500w`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{RecipeBadges,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Surface code coverage metrics from SonarQube in failed Scorecard rules","description":null,"href":"/guides/security/code-coverage-rules"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[148,1123,")=>null;function _cr"]]},"mdxExtracts":{"tableOfContents":[{"title":"Capturing code coverage from SonarQube","slug":"capturing-code-coverage-from-sonarqube","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/cortex-290c0c42/ed8d91d3153959c2/kapa.js","/_mintlify/custom/cortex-290c0c42/36b87f2caabcf780/status-tags.js","/_mintlify/custom/cortex-290c0c42/cc8557fef10c63cd/changelog-dates.js"],"dynamicCss":".mint-mb-6 {\n margin-bottom: 1.5rem\n}\n.mint-flex {\n display: flex\n}\n.mint-flex-wrap {\n flex-wrap: wrap\n}\n.mint-gap-2 {\n gap: 0.5rem\n}\n.mint-rounded-lg {\n border-radius: 0.5rem\n}\n.mint-px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem\n}\n.mint-py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem\n}\n.mint-text-xs {\n font-size: 0.75rem;\n line-height: 1rem\n}\n.mint-font-medium {\n font-weight: 500\n}","subdomain":"cortex-290c0c42","siteName":"Cortex","title":"Surface code coverage metrics from SonarQube in failed Scorecard rules - Cortex","relatedPagesConfig":{"enabled":true,"limit":3,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-10T23:58:33.751Z","gitLastModified":"2026-09-28T23:53:10.000Z","originalFileLocation":"guides/security/code-coverage-rules.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Cortex\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Surface code coverage metrics from SonarQube in failed Scorecard rules - Cortex\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Cortex\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cortex.io/guides/security/code-coverage-rules\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cortex-290c0c42.mintlify.site/_mintlify/api/og/v2?division=Scorecards\u0026amp;title=Surface+code+coverage+metrics+from+SonarQube+in+failed+Scorecard+rules\u0026amp;theme=99c32ff148ebb22d9370f9e9\u0026amp;signature=3ea09ce94079381b58132a207a4a40f042f258df1c696c877090bdb50f1e0794\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Surface code coverage metrics from SonarQube in failed Scorecard rules - Cortex\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cortex-290c0c42.mintlify.site/_mintlify/api/og/v2?division=Scorecards\u0026amp;title=Surface+code+coverage+metrics+from+SonarQube+in+failed+Scorecard+rules\u0026amp;theme=99c32ff148ebb22d9370f9e9\u0026amp;signature=3ea09ce94079381b58132a207a4a40f042f258df1c696c877090bdb50f1e0794\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cortex-290c0c42/GsIUSGAJ7s7HMHgE/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Cortex\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#653EE8\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cortex.io/guides/security/code-coverage-rules\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/security/code-coverage-rules.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cortex.io/#organization\",\"name\":\"Cortex\",\"url\":\"https://docs.cortex.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cortex-290c0c42/JcmXgfdiEzZzqS2M/logo/cortex-light.svg?fit=max\u0026auto=format\u0026n=JcmXgfdiEzZzqS2M\u0026q=85\u0026s=3d32dd91336a0de9463a57e04f9b8bb3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cortex.io#website\",\"name\":\"Cortex\",\"url\":\"https://docs.cortex.io\",\"publisher\":{\"@id\":\"https://docs.cortex.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cortex.io/guides/security/code-coverage-rules#webpage\",\"url\":\"https://docs.cortex.io/guides/security/code-coverage-rules\",\"name\":\"Surface code coverage metrics from SonarQube in failed Scorecard rules\",\"dateModified\":\"2026-09-28T23:53:10.000Z\",\"isPartOf\":{\"@id\":\"https://docs.cortex.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cortex.io/guides/security/code-coverage-rules#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cortex.io/guides/security/code-coverage-rules#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Product areas\",\"item\":\"https://docs.cortex.io/guides/operational-readiness/keep-your-catalog-up-to-date\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Scorecards\",\"item\":\"https://docs.cortex.io/guides/product-areas/scorecards\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Surface code coverage metrics from SonarQube in failed Scorecard rules\",\"item\":\"https://docs.cortex.io/guides/security/code-coverage-rules\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.cortex.io/guides/security/code-coverage-rules#article\",\"headline\":\"Surface code coverage metrics from SonarQube in failed Scorecard rules\",\"name\":\"Surface code coverage metrics from SonarQube in failed Scorecard rules\",\"url\":\"https://docs.cortex.io/guides/security/code-coverage-rules\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cortex.io/guides/security/code-coverage-rules#webpage\"},\"dateModified\":\"2026-09-28T23:53:10.000Z\",\"publisher\":{\"@id\":\"https://docs.cortex.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cortex.io#website\"}}]}\u003c/script>","agentPointerHref":"/guides/security/code-coverage-rules.md","siteName":"Cortex","nav":{"global":null,"tabs":[{"tab":"Product Docs","icon":"books","pages":[{"title":"Product Docs","href":""}]},{"tab":"Cookbooks","icon":"hat-chef","groups":[{"group":" ","pages":[{"title":"Cookbooks","icon":"hat-chef","href":"/guides"}]},{"group":"Product areas","pages":[{"group":"Catalogs","root":{"title":"Catalogs","href":"/guides/product-areas/catalogs"},"pages":[{"title":"Keep your catalog up to date","href":"/guides/operational-readiness/keep-your-catalog-up-to-date"}]},{"group":"Scorecards","root":{"title":"Scorecards","href":"/guides/product-areas/scorecards"},"pages":[{"title":"Establish consistent AI security controls","href":"/guides/ai-excellence/establish-consistent-ai-security-controls"},{"title":"Set benchmarks for AI readiness","href":"/guides/ai-excellence/set-benchmarks-for-ai-readiness"},{"title":"Prepare for effective use of AI tools","href":"/guides/ai-excellence/prepare-for-effective-use-of-ai-tools"},{"title":"Seasonal readiness Scorecard","href":"/guides/production-readiness/seasonal-readiness-scorecard"},{"title":"Reduce MTTA","href":"/guides/incident-mgmt/reduce-mtta"},{"title":"Reduce MTTR","href":"/guides/incident-mgmt/reduce-mttr"},{"title":"Manage an Upcoming EOL for AWS","href":"/guides/migrations-and-modernization/manage-an-upcoming-eol-for-aws"},{"title":"Accelerate migration to K8s","href":"/guides/migrations-and-modernization/accelerate-migration-to-k8s"},{"title":"Ensure SOC 2 compliance","href":"/guides/compliance/soc2"},{"title":"Measure DORA progress","href":"/guides/dora/scorecard"},{"title":"Enforce security standards","href":"/guides/security/scorecard"},{"title":"Surface vulnerability data in failed Scorecard rules","description":null,"href":"/guides/security/vulnerabilities-rules"},{"title":"Surface code coverage metrics from SonarQube in failed Scorecard rules","href":"/guides/security/code-coverage-rules"}]},{"group":"Workflows","root":{"title":"Workflows","description":null,"href":"/guides/product-areas/workflows"},"pages":[{"title":"Scaffold an ML model project","href":"/guides/ai-excellence/scaffold-ml-model"},{"group":"Manage Terraform infrastructure","root":{"title":"Manage Terraform infrastructure","href":"/guides/production-readiness/terraform"},"pages":[{"title":"Provision EC2 instance with Terraform","href":"/guides/production-readiness/terraform/provision"},{"title":"Update EC2 instance","href":"/guides/production-readiness/terraform/update"},{"title":"Terraform destroy","href":"/guides/production-readiness/terraform/destroy"}]},{"title":"Standardize new service creation","href":"/guides/production-readiness/standardize-new-service-creation"},{"title":"Rollback a service during an incident","href":"/guides/incident-mgmt/workflow-rollback"},{"title":"Create ServiceNow incident","href":"/guides/incident-mgmt/servicenow"},{"title":"Automate new dev environment","href":"/guides/dev-onboarding/env-setup-workflow"},{"title":"Automate user access to GitHub, PagerDuty, and Jira","href":"/guides/dev-onboarding/automate-user-access-to-github-pagerduty-and-jira"},{"title":"Automate user access to Copilot","href":"/guides/dev-onboarding/automate-user-access-to-copilot"},{"title":"Kick off a Jenkins pipeline","href":"/guides/operational-readiness/jenkins-workflow"},{"title":"Call internal service endpoints in a Workflow","href":"/guides/operational-readiness/internal-endpoints"},{"title":"Run a Humanitec pipeline","href":"/guides/operational-readiness/humanitec-pipeline"},{"title":"Trigger internal Jenkins jobs","href":"/guides/operational-readiness/jenkins-axon"},{"title":"Automate a sync in ArgoCD","href":"/guides/operational-readiness/argocd-workflow"},{"title":"Loop in a JavaScript block and return specified output","href":"/guides/operational-readiness/javascript-looping"},{"title":"Link SOC 2 documents to entity","href":"/guides/compliance/link-soc2-docs"},{"title":"Bulk accept entity data verifications","href":"/guides/compliance/bulk-accept-entity-data-verifications"}]},{"group":"Eng Intelligence","root":{"title":"Eng Intelligence","href":"/guides/product-areas/eng-intelligence"},"pages":[{"title":"Measure AI impact","href":"/guides/ai-excellence/measure-ai-impact"},{"title":"Improve bottlenecks in your software development lifecycle","href":"/guides/production-readiness/improve-bottlenecks"},{"title":"Tracking cloud costs","href":"/guides/operational-readiness/tracking-cloud-costs"}]},{"group":"OpEx Review","root":{"title":"OpEx Review","tag":"PUBLIC BETA","href":"/guides/product-areas/opex-review"},"tag":"PUBLIC BETA","pages":[{"title":"Run OpEx reviews that end in decisions","tag":"PUBLIC BETA","href":"/guides/operational-readiness/run-effective-opex-reviews"}]},{"group":"Data verification","root":{"title":"Data verification","href":"/guides/product-areas/data-verification"},"pages":[{"title":"Verify services after AI-based auto-mapping","href":"/guides/ai-excellence/verify-auto-mappings"},{"title":"Validate data after migration","href":"/guides/migrations-and-modernization/validate-data"},{"title":"Data verifications for audit readiness","href":"/guides/compliance/data-verification"}]},{"group":"Plugins","root":{"title":"Plugins","href":"/guides/product-areas/plugins"},"pages":[{"title":"Visualizing custom data in a plugin","href":"/guides/operational-readiness/visualizing-custom-data-in-a-plugin"}]},{"group":"Cortex MCP","root":{"title":"Cortex MCP","href":"/guides/product-areas/cortex-mcp"},"pages":[{"title":"Put your Cortex data to work in your agents","href":"/guides/ai-excellence/put-your-cortex-data-to-work-in-your-agents"}]}]}]},{"tab":"API Reference","icon":"brain","pages":[{"title":"API Reference","href":"/api"}]},{"tab":"Changelog","icon":"clock-rotate-left","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Surface code coverage metrics from SonarQube in failed Scorecard rules - Cortex","deploymentId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","buildId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-C5J5Gw3i.js","lightbox-handle-r17bVUz3.js"]}