-
-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: average time to production chart #6565
Conversation
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 0 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method ExecutiveDashboard.tsx: ExecutiveDashboard:VFC
- Large Method createChartOptions.ts: createOptions
- Complex Conditional useGroupedProjectTrends.ts: groupDataByProject
|
||
const groupedProjectsData = useGroupedProjectTrends(projectsData); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Complex Method
ExecutiveDashboard:VFC already has high cyclomatic complexity, and now it increases in Lines of Code from 171 to 182
Why does this problem occur?
This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more.
To ignore this warning click here.
interaction: { | ||
axis: 'xy', | ||
mode: 'nearest', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Large Method
createOptions increases from 75 to 79 lines of code, threshold = 70
Why does this problem occur?
Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function. Read more.
To ignore this warning click here.
export function groupDataByProject<T extends { project: string }>( | ||
data: T[], | ||
): GroupedDataByProject<T[]> { | ||
if (!data || data.length === 0 || !('project' in data[0])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ New issue: Complex Conditional
groupDataByProject has 1 complex conditionals with 2 branches, threshold = 2
Why does this problem occur?
A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell. Read more.
To ignore this warning click here.
<MetricsSummaryChart metricsSummaryTrends={metricsData} /> | ||
<MetricsSummaryChart | ||
metricsSummaryTrends={groupedMetricsData} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This chart needed to first group the data per project
interaction: { | ||
axis: 'xy', | ||
mode: 'nearest', | ||
}, | ||
external: createTooltip(setTooltip), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes the tooltip visible all the time changing according to to the nearest datapoint
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method ExecutiveDashboard.tsx: ExecutiveDashboard:VFC
- Large Method createChartOptions.ts: createOptions
- Complex Conditional useGroupedProjectTrends.ts: groupDataByProject
✅ Improving Code Health:
isAggregate?: boolean; | ||
} | ||
|
||
export const ProjectHealthChart: VFC<IFlagsProjectChartProps> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ No longer an issue: Complex Method
ProjectHealthChart:VFC<IFlagsProjectChartProps> is no longer above the threshold for cyclomatic complexity
Why does this problem occur?
This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more.
isAggregate?: boolean; | ||
} | ||
|
||
export const ProjectHealthChart: VFC<IFlagsProjectChartProps> = ({ | ||
export const ProjectHealthChart: VFC<IProjectHealthChartProps> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ New issue: Complex Method
ProjectHealthChart:VFC<IProjectHealthChartProps> has a cyclomatic complexity of 12, threshold = 10
Why does this problem occur?
This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more.
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
if (input <= ONE_WEEK) { | ||
return <Badge color='success'>High</Badge>; | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as used in the Dora metrics
isAggregate?: boolean; | ||
} | ||
|
||
export const ProjectHealthChart: VFC<IFlagsProjectChartProps> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also started with grouping the data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method ExecutiveDashboard.tsx: ExecutiveDashboard:VFC
- Large Method createChartOptions.ts: createOptions
- Complex Conditional useGroupedProjectTrends.ts: groupDataByProject
✅ Improving Code Health:
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method ExecutiveDashboard.tsx: ExecutiveDashboard:VFC
- Large Method createChartOptions.ts: createOptions
- Complex Conditional useGroupedProjectTrends.ts: groupDataByProject
✅ Improving Code Health:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method ExecutiveDashboard.tsx: ExecutiveDashboard:VFC
- Large Method createChartOptions.ts: createOptions
- Complex Conditional useGroupedProjectTrends.ts: groupDataByProject
✅ Improving Code Health:
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method ExecutiveDashboard.tsx: ExecutiveDashboard:VFC
- Large Method createChartOptions.ts: createOptions
- Complex Conditional useGroupedProjectTrends.ts: groupDataByProject
✅ Improving Code Health:
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method ExecutiveDashboard.tsx: ExecutiveDashboard:VFC
- Large Method createChartOptions.ts: createOptions
- Complex Conditional useGroupedProjectTrends.ts: groupDataByProject
✅ Improving Code Health:
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Complex Method ExecutiveDashboard.tsx: ExecutiveDashboard:VFC
- Large Method createChartOptions.ts: createOptions
- Complex Conditional useGroupedProjectTrends.ts: groupDataByProject
Adds live data to TimeToProductionChart and AverageTimeToProduction gauge.
Create a custom tooltip
Changes the interaction mode for tooltips as per @nicolaesocaciu pairing session
Improvement:
Extract grouping by project to its own hook (3 charts that needed grouped data where handling it independently.
Closes # 1-2143