blob: f411f64a6df1b1c7b0553b26745d07dc5cf89189 [file] [log] [blame]
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 29,
"iteration": 1682063057579,
"links": [],
"panels": [
{
"datasource": null,
"gridPos": {
"h": 3,
"w": 13,
"x": 0,
"y": 0
},
"id": 19,
"options": {
"content": "- Use Cases: This dashboard shows the code quality metrics from SonarQube.\n- Data Source Required: SonarQube v8.2+",
"mode": "markdown"
},
"pluginVersion": "8.0.6",
"targets": [
{
"queryType": "randomWalk",
"refId": "A"
}
],
"title": "Dashboard Introduction",
"type": "text"
},
{
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 3
},
"id": 16,
"title": "Reliability & Security",
"type": "row"
},
{
"datasource": "-- Mixed --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bugs"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 6,
"x": 0,
"y": 4
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "vertical",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n count(*) as 'Bugs'\nFROM cq_issues\nWHERE\n $__timeFilter(created_date)\n and project_key in ($project_id)\n and `type` = 'BUG'\nORDER BY created_date",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Reliability",
"type": "stat"
},
{
"datasource": "-- Mixed --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "vulnerabilities"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 6,
"x": 6,
"y": 4
},
"id": 3,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n count(*) as 'Vulnerabilities'\nFROM cq_issues\nWHERE\n $__timeFilter(created_date)\n and project_key in ($project_id)\n and `type` = 'VULNERABILITY'\nORDER BY created_date",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Security",
"type": "stat"
},
{
"datasource": "-- Mixed --",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 6,
"x": 12,
"y": 4
},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n COUNT(IF(status = 'TO_REVIEW', 1, NULL)) AS 'Security Hotspots'\nFROM cq_issues\nWHERE\n $__timeFilter(created_date)\n and project_key in ($project_id)\n and `type` = 'HOTSPOTS'\nORDER BY created_date",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Security Hotspots",
"type": "stat"
},
{
"datasource": "-- Mixed --",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 6,
"x": 18,
"y": 4
},
"id": 13,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n CONCAT(ROUND(COUNT(IF(status != 'TO_REVIEW', 1, NULL)) / COUNT(*) * 100, 2), '%') AS 'Reviewed'\nFROM cq_issues\nWHERE\n $__timeFilter(created_date)\n and project_key in ($project_id)\n and `type` = 'HOTSPOTS'\nORDER BY created_date",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Security Reviewed",
"type": "stat"
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 8
},
"id": 12,
"panels": [],
"title": "Test & Maintainability",
"type": "row"
},
{
"datasource": "-- Mixed --",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 0,
"y": 9
},
"id": 8,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n CONCAT(ROUND((sum(lines_to_cover) - sum(uncovered_lines)) / sum(lines_to_cover) * 100, 1), '% ', 'Coverage on ', ROUND(sum(lines_to_cover) / 1000, 0),'k Lines to cover')\nFROM cq_file_metrics\nWHERE\n project_key in ($project_id)\n",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Test",
"type": "stat"
},
{
"datasource": "-- Mixed --",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 6,
"y": 9
},
"id": 7,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n CONCAT(ROUND(SUM(debt) / (8 * 60), 0), ' days') AS 'Debt'\nFROM cq_issues\nWHERE\n $__timeFilter(created_date)\n and project_key in ($project_id)",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Maintainability - Debt",
"type": "stat"
},
{
"datasource": "-- Mixed --",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 12,
"y": 9
},
"id": 14,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n\tCOUNT(if(type = 'CODE_SMELL', 1, null)) as 'Code Smells'\nFROM cq_issues\nWHERE\n $__timeFilter(created_date)\n and project_key in ($project_id)",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Maintainability - Code Smells",
"type": "stat"
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 14
},
"id": 6,
"panels": [],
"title": "Duplication & Code",
"type": "row"
},
{
"datasource": "-- Mixed --",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 0,
"y": 15
},
"id": 10,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n sum(duplicated_blocks)\nFROM cq_file_metrics\nWHERE\n project_key in ($project_id)\n",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Duplicated Blocks",
"type": "stat"
},
{
"datasource": "-- Mixed --",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 6,
"y": 15
},
"id": 9,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n CONCAT(ROUND(sum(duplicated_lines) / sum(num_of_lines) * 100, 1), '% ', 'Duplications on ', ROUND(sum(ncloc) / 1000, 0),'k Lines')\nFROM cq_file_metrics\nWHERE\n project_key in ($project_id)\n",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Duplicated Lines",
"type": "stat"
},
{
"datasource": "-- Mixed --",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"displayMode": "color-text",
"filterable": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 20
},
"id": 17,
"options": {
"showHeader": true
},
"pluginVersion": "8.0.6",
"targets": [
{
"datasource": "mysql",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "SELECT\n\tfile_name, num_of_lines as 'Lines of Code', bugs as 'Bugs', vulnerabilities as 'Vulnerabilities', code_smells as 'Code Smells', \n\tsecurity_hotspots as 'Security Hotspots', CONCAT(ROUND(coverage, 2), '%') as 'Coverage', CONCAT(ROUND(duplicated_lines_density, 2), '%') as 'Duplications'\nFROM cq_file_metrics\nWHERE\n project_key in ($project_id)\n order by bugs\nlimit $rows",
"refId": "A",
"select": [
[
{
"params": [
"blueprint_id"
],
"type": "column"
}
]
],
"table": "_devlake_blueprint_labels",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Code Quality Metrics by Files",
"type": "table"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": "mysql",
"definition": "select concat(name, '--', id) as text from cq_projects",
"description": null,
"error": null,
"hide": 0,
"includeAll": true,
"label": "Choose Project",
"multi": true,
"name": "project_id",
"options": [],
"query": "select concat(name, '--', id) as text from cq_projects",
"refresh": 1,
"regex": "/^(?<text>.*)--(?<value>.*)$/",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"allValue": null,
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": "mysql",
"definition": "select distinct(type) from cq_issues",
"description": null,
"error": null,
"hide": 0,
"includeAll": true,
"label": "Issue Type",
"multi": true,
"name": "issue_type",
"options": [],
"query": "select distinct(type) from cq_issues",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"allValue": null,
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": "mysql",
"definition": "select distinct(severity) from cq_issues",
"description": null,
"error": null,
"hide": 0,
"includeAll": true,
"label": "Severity",
"multi": true,
"name": "severity",
"options": [],
"query": "select distinct(severity) from cq_issues",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"allValue": null,
"current": {
"selected": false,
"text": "20",
"value": "20"
},
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": "rows",
"multi": false,
"name": "rows",
"options": [
{
"selected": true,
"text": "20",
"value": "20"
},
{
"selected": false,
"text": "50",
"value": "50"
},
{
"selected": false,
"text": "100",
"value": "100"
}
],
"query": "20,50,100",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
}
]
},
"time": {
"from": "now-10y",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "SonarQube",
"uid": "WA0qbuJ4k",
"version": 1
}