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

Reduce DART file sizes to make the PR automated checks work. #830

Closed
palisadoes opened this issue May 22, 2021 · 8 comments
Closed

Reduce DART file sizes to make the PR automated checks work. #830

palisadoes opened this issue May 22, 2021 · 8 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers test Testing application

Comments

@palisadoes
Copy link
Contributor

Describe the bug

  1. One of our pull request checks is to ensure that Dart files have under 300 lines of code. This is because we found many instances of duplicated code and felt that adding a 300 line limit would encourage people to create reusable code.
  2. We have 9 files in the repository that are over 300 lines long.
  3. These need to be reduced in size by using efficiently elegant coding techniques.
  4. We need this fixed so that contributors can have all their checks pass.

To Reproduce
Steps to reproduce the behavior:

  1. Submit a PR with over 300 lines of code.
  2. Look at the failed checks. It shows the files in the Actual Behavior section to be too large

Expected behavior
Pull requests passing all GitHub action tests

Actual behavior

The files below are consistently flagged as being too large.

Line count:   482 File: /home/runner/work/talawa/talawa/lib/views/pages/events/edit_event_dialog.dart
Line count:   371 File: /home/runner/work/talawa/talawa/lib/views/pages/organization/organization_members.dart
Line count:   547 File: /home/runner/work/talawa/talawa/lib/views/pages/organization/update_profile_page.dart
Line count:   320 File: /home/runner/work/talawa/talawa/lib/views/pages/organization/update_organization.dart
Line count:   355 File: /home/runner/work/talawa/talawa/lib/views/pages/organization/organization_settings.dart
Line count:   308 File: /home/runner/work/talawa/talawa/lib/views/pages/login_signup/register_form.dart
Line count:   542 File: /home/runner/work/talawa/talawa/lib/views/pages/login_signup/set_url_page.dart
Line count:   973 File: /home/runner/work/talawa/talawa/lib/services/queries_.dart
Line count:   312 File: /home/runner/work/talawa/talawa/test/widget_tests/register_form_test.dart

Screenshots
image

image

Additional details
None

@github-actions github-actions bot added bug Something isn't working test Testing application unapproved Unapproved, needs to be triaged labels May 22, 2021
@palisadoes palisadoes added the good first issue Good for newcomers label May 22, 2021
@anand-aman
Copy link
Contributor

Can I work on this issue? @palisadoes

@palisadoes palisadoes removed the unapproved Unapproved, needs to be triaged label May 22, 2021
@palisadoes
Copy link
Contributor Author

palisadoes commented May 22, 2021

@anand-aman you can verify the file sizes by running the countline.py script.

@anand-aman
Copy link
Contributor

@anand-aman you can verify the file sizes by running the countline.py script.

Ok will check it. Thanks

@palisadoes
Copy link
Contributor Author

@anand-aman how's progress?

@anand-aman
Copy link
Contributor

@palisadoes I am working on it. While working on this issue I came across this bug #833.

@anand-aman
Copy link
Contributor

@palisadoes
Sir, I have reduced the size of all files (except queries_.dart which is 973 lines) and tested it.
Can we keep queries_.dart as an exception till the new UI is implemented?

Thank You
Aman Anand

@palisadoes
Copy link
Contributor Author

palisadoes commented May 27, 2021

@anand-aman yes that is OK. Please submit the PR so the others can use your work as an example.

@anand-aman
Copy link
Contributor

Update:
Merged with PR #852.
Refactoring of queries.dart_ is pending and will be done after code freeze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers test Testing application
Projects
None yet
Development

No branches or pull requests

2 participants