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

refactor: decrease complexity of ActionForm, NetworkTable, MachineForms #5452

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

petermakowski
Copy link
Contributor

Done

  • refactor: decrease complexity of ActionForm, NetworkTable, MachineForms

    • add eslint-plugin-complexity
    • add complexity lint rule with max of 25

    This is related to TICS checks and intends to improve the overall score for maas-ui.

@webteam-app
Copy link

@petermakowski petermakowski requested a review from ndv99 June 5, 2024 13:31
@ndv99
Copy link
Contributor

ndv99 commented Jun 5, 2024

This looks really clean, I like it. What's the rationale for setting the complexity limit to 25? Is this a recommendation from TiCS, or just reflective of our codebase?

@petermakowski
Copy link
Contributor Author

This looks really clean, I like it. What's the rationale for setting the complexity limit to 25? Is this a recommendation from TiCS, or just reflective of our codebase?

Very good question, Nick. This is the lowest setting that works in our codebase without refactoring large number of files. I think we should aim at complexity level of 10. I'll add a JIRA issue to our technical debt objective for this.

@petermakowski
Copy link
Contributor Author

@ndv99 https://warthogs.atlassian.net/browse/MAASENG-3342

@petermakowski petermakowski changed the title refactor: decrease complexity of ActionForm, NetworkTable, MachineForms refactor: decrease complexity of ActionForm, NetworkTable, MachineForms WIP Jun 5, 2024
@petermakowski petermakowski force-pushed the test-add-complexity branch 5 times, most recently from ca06aba to 1ec703c Compare June 5, 2024 15:00
@petermakowski petermakowski changed the title refactor: decrease complexity of ActionForm, NetworkTable, MachineForms WIP refactor: decrease complexity of ActionForm, NetworkTable, MachineForms Jun 6, 2024
@petermakowski petermakowski marked this pull request as ready for review June 6, 2024 11:32
- add eslint-plugin-complexity
- add complexity lint rule with max of 25

Signed-off-by: Peter Makowski <me+git@petermakowski.io>
Copy link
Contributor

@ndv99 ndv99 left a comment

Choose a reason for hiding this comment

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

LGTM!

@petermakowski petermakowski merged commit 94310e9 into canonical:main Jun 6, 2024
7 checks passed
@petermakowski petermakowski deleted the test-add-complexity branch June 6, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants