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: frontend api clean up not needed columns #6489

Merged
merged 2 commits into from
Mar 11, 2024
Merged

feat: frontend api clean up not needed columns #6489

merged 2 commits into from
Mar 11, 2024

Conversation

sjaanus
Copy link
Contributor

@sjaanus sjaanus commented Mar 11, 2024

  1. Clean up not used fields
  2. Fix a bug where segment was not attached

Copy link

vercel bot commented Mar 11, 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 11, 2024 11:20am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Mar 11, 2024 11:20am

@@ -142,6 +140,9 @@ export default class ClientFeatureToggleReadModel
feature.strategies = feature.strategies || [];
feature.strategies.push(this.rowToStrategy(row));
}
if (row.segment_id) {
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 was missing from new query

@@ -36,7 +36,6 @@ export default class ClientFeatureToggleReadModel
'features.project as project',
'features.stale as stale',
'features.impression_data as impression_data',
'features.created_at as created_at',
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 is not used

@@ -118,7 +117,6 @@ export default class ClientFeatureToggleReadModel
project: row.project,
stale: row.stale,
type: row.type,
dependencies: [],
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 is same as in old frontend api.

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: 2 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 +143 to +145
if (row.segment_id) {
this.addSegmentIdsToStrategy(feature, row);
}

Choose a reason for hiding this comment

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

❌ Getting worse: Complex Method
ClientFeatureToggleReadModel.getAggregatedData increases in cyclomatic complexity from 13 to 14, threshold = 9

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.

@@ -36,7 +36,6 @@ export default class ClientFeatureToggleReadModel
'features.project as project',
'features.stale as stale',
'features.impression_data as impression_data',
'features.created_at as created_at',

Choose a reason for hiding this comment

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

❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.29 across 7 functions. The mean complexity threshold is 4

Why does this problem occur?

This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals. Read more.

To ignore this warning click here.

Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

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

We need a test to show a bug we fixed

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: 2 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):

@sjaanus sjaanus merged commit 0cf7b32 into main Mar 11, 2024
14 checks passed
@sjaanus sjaanus deleted the cleanup-fields branch March 11, 2024 11:41
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