fix: added handling for show cli
This commit is contained in:
@@ -1004,6 +1004,12 @@ async function displayTaskById(tasksPath, taskId, complexityReportPath = null) {
|
||||
chalk.cyan.bold('Status:'),
|
||||
getStatusWithColor(task.status || 'pending', true)
|
||||
],
|
||||
[
|
||||
chalk.cyan.bold('Complexity:'),
|
||||
task.complexityScore
|
||||
? getComplexityWithColor(task.complexityScore)
|
||||
: chalk.gray('N/A')
|
||||
],
|
||||
[
|
||||
chalk.cyan.bold('Description:'),
|
||||
task.description || 'No description provided.'
|
||||
@@ -1177,6 +1183,12 @@ async function displayTaskById(tasksPath, taskId, complexityReportPath = null) {
|
||||
complexityReport
|
||||
) // Pass complexityReport
|
||||
],
|
||||
[
|
||||
chalk.cyan.bold('Complexity:'),
|
||||
task.complexityScore
|
||||
? getComplexityWithColor(task.complexityScore)
|
||||
: chalk.gray('N/A')
|
||||
],
|
||||
[chalk.cyan.bold('Description:'), task.description]
|
||||
);
|
||||
|
||||
|
||||
@@ -281,14 +281,16 @@ function findTaskById(tasks, taskId, complexityReport = null) {
|
||||
if (taskResult && complexityReport) {
|
||||
if (complexityReport && complexityReport.complexityAnalysis) {
|
||||
// For a main task, look for a direct match
|
||||
if (!taskResult.isSubtask) {
|
||||
const taskAnalysis = complexityReport.complexityAnalysis.find(
|
||||
(analysis) => analysis.taskId === taskResult.id
|
||||
);
|
||||
const taskId = taskResult.isSubtask
|
||||
? taskResult.parentTask.id
|
||||
: taskResult.id;
|
||||
|
||||
if (taskAnalysis) {
|
||||
taskResult.complexityScore = taskAnalysis.complexityScore;
|
||||
}
|
||||
const taskAnalysis = complexityReport.complexityAnalysis.find(
|
||||
(analysis) => analysis.taskId === taskId
|
||||
);
|
||||
|
||||
if (taskAnalysis) {
|
||||
taskResult.complexityScore = taskAnalysis.complexityScore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user