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

fix: total flags and flags per user when all projects #6787

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

andreas-unleash
Copy link
Contributor

@andreas-unleash andreas-unleash commented Apr 5, 2024

Fixes the flag stats flagsPerUser calculation and display value.
Previously the calculation depended on project data which might not be there with the permission changes

Closes # 1-2255

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

vercel bot commented Apr 5, 2024

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

Name Status Preview Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview Apr 5, 2024 10:21am
1 Ignored Deployment
Name Status Preview Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Apr 5, 2024 10:21am

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: 1 findings(s) 🚩

View detailed results in CodeScene

@@ -66,6 +71,7 @@ const ChartWidget = styled(Widget)(({ theme }) => ({

export const InsightsCharts: VFC<IChartsProps> = ({
projects,
flags,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Getting worse: Large Method
InsightsCharts:VFC<IChartsProps> increases from 137 to 147 lines of code, threshold = 120

Suppress

flags: InstanceInsightsSchemaFlags,
users: InstanceInsightsSchemaUsers,
) {
const flagsPerUserCalculation = flags.total / users.total;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function can receive more primitive type, and thus be simplified. I would pass flags.total and users.total instead of entire objects. Also formatFlagsPerUser would be more descriptive to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand what you mean here

Copy link
Member

@Tymek Tymek Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't need to have complex arguments. It can probably work with ? number | null arguments instead, and be called as formatFlagsPerUser(flags.total, users.total)

@andreas-unleash andreas-unleash merged commit 60262e5 into main Apr 9, 2024
15 checks passed
@andreas-unleash andreas-unleash deleted the fix/total_Flags_Stats branch April 9, 2024 07:52
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