Skip to content
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

Merged
merged 9 commits into from
Mar 15, 2024

Conversation

andreas-unleash
Copy link
Contributor

@andreas-unleash andreas-unleash commented Mar 14, 2024

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.

Screenshot 2024-03-14 at 17 19 07

Closes # 1-2143

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link

vercel bot commented Mar 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 15, 2024 8:33am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Mar 15, 2024 8:33am

@andreas-unleash andreas-unleash changed the title fix: average time to production chart feat: average time to production chart Mar 14, 2024
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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):

Comment on lines +81 to +83

const groupedProjectsData = useGroupedProjectTrends(projectsData);

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.

Comment on lines +31 to +34
interaction: {
axis: 'xy',
mode: 'nearest',
},

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])) {

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}
/>
Copy link
Contributor Author

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),
Copy link
Contributor Author

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>
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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):

✅ Improving Code Health:

isAggregate?: boolean;
}

export const ProjectHealthChart: VFC<IFlagsProjectChartProps> = ({

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> = ({

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>;
}
};
Copy link
Contributor Author

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> = ({
Copy link
Contributor Author

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

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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):

✅ Improving Code Health:

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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):

✅ Improving Code Health:

Copy link
Contributor

@FredrikOseberg FredrikOseberg left a 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>
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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):

✅ Improving Code Health:

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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):

✅ Improving Code Health:

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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):

✅ Improving Code Health:

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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):

✅ Improving Code Health:

@andreas-unleash andreas-unleash merged commit 4563468 into main Mar 15, 2024
13 checks passed
@andreas-unleash andreas-unleash deleted the feat/time_to_production_chart_data branch March 15, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants