Skip to content

Conversation

@goderbauer
Copy link
Member

I am experimenting with the dead code detector from https://pub.dev/packages/dart_code_metrics. This is what in found running on the tool (and some obvious false positives not included in this PR).

$ dart run dart_code_metrics:metrics check-unused-code lib in packages/flutter_tool.

@flutter-dashboard flutter-dashboard bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels May 24, 2022
@goderbauer
Copy link
Member Author

@christopherfujino Can we delete all of this? Appears to be unused from within the tool.

@christopherfujino
Copy link
Contributor

Wow!

@christopherfujino
Copy link
Contributor

christopherfujino commented May 25, 2022

We definitely can't merge this as is, for example proxied_devices.dart is actively used internally by 1p customers. In addition, the flutter_tools/lib/src/migrate code will be used imminently by forthcoming PRs from @GaryQian.

I think we should probably break this up into smaller PRs that can be more easily reviewed (and potentially reverted). I'm marking this a draft and I'll get the ball rolling with a PR with some obvious deletions.

@christopherfujino christopherfujino marked this pull request as draft May 25, 2022 18:47
@christopherfujino
Copy link
Contributor

christopherfujino commented May 25, 2022

@goderbauer I'm curious as to what the obvious false positives the tool detected were?

@christopherfujino
Copy link
Contributor

I scheduled a FRoB run, for science

@goderbauer
Copy link
Member Author

@goderbauer I'm curious as to what the obvious false positives the tool detected were?

There was some code that was used only by tests that the tool wanted to delete. Also, I excluded ValidateProjectCommand and stuff under lib/src/migrate from removal because it looked like those things were actively worked on. Looks like I forgot to revert one thing under lib/src/migrate as you pointed out above.

We definitely can't merge this as is, for example proxied_devices.dart is actively used internally by 1p customers.

Makes sense. Maybe we should include that information about proxied_devices.dart in its doc comment.

In addition, the flutter_tools/lib/src/migrate code will be used imminently by forthcoming PRs from @GaryQian.

I thought I reverted all the changes under lib/src/migrate (there were more) but looks like I missed one...

I think we should probably break this up into smaller PRs that can be more easily reviewed (and potentially reverted). I'm marking this a draft and I'll get the ball rolling with a PR with some obvious deletions.

Sounds good! Thanks for getting the ball rolling!

@christopherfujino
Copy link
Contributor

I'm waiting for Google testing to finish before opening my follow-up PR

@goderbauer
Copy link
Member Author

From looking at some of the failing tests it looks like google3 is unhappy about the removal of ProxiedDevices (as you predicted) and the removal of the deviceManager getter. I am gonna add those back in and then re-run FRoB to see if there's anything else.

@goderbauer
Copy link
Member Author

@christopherfujino Do you know what button I need to click in FRoB to trigger another test run with the latest commit?

@goderbauer
Copy link
Member Author

Since I didn't know how to retrigger FRoB on an existing PR, I opened a new one with the changes discussed in the comment above. Looks like Google3 is now fine with this: http://flutter-rob/#/flutter/premerge_prs?pr=104652.

@christopherfujino I'll let you take it from here and decide how you want to split this up.

@Hixie Hixie closed this Aug 9, 2022
@goderbauer goderbauer deleted the unused-in-tools branch March 3, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants