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

🦺[Tech Debt] Mark Unused code script #145

Closed
1 of 2 tasks
kcw-grunt opened this issue Nov 7, 2022 · 1 comment · Fixed by #147
Closed
1 of 2 tasks

🦺[Tech Debt] Mark Unused code script #145

kcw-grunt opened this issue Nov 7, 2022 · 1 comment · Fixed by #147
Assignees
Labels
🦺 tech debt Actions that help maintain the repo and application

Comments

@kcw-grunt
Copy link
Contributor

kcw-grunt commented Nov 7, 2022

Goal

Describe the work to be done

To further manage our codebase we should add a script that lets us know that we added code that is not being used.
To do this effectively, I recommend adding all the code in a container directory. This way it wouldn't look at dependencies (which we wouldn't want to touch)

Reference

#Unused
file="${SRCROOT}/BuildTools/unused.rb"
if [ -f "$file" ]
then
echo "$file found."
ruby ${SRCROOT}/BuildTools/unused.rb xcode
else
echo "unused.rb doesn't exist"
fi

Definition of Done

  • Compiles and sets warnings when code classes and/or methods are unused
  • Bonus Points: Global switch on / off for developers
@kcw-grunt kcw-grunt added the 🦺 tech debt Actions that help maintain the repo and application label Nov 7, 2022
@kcw-grunt kcw-grunt assigned kcw-grunt and Iferencak and unassigned kcw-grunt Nov 7, 2022
@Iferencak Iferencak linked a pull request Nov 7, 2022 that will close this issue
@Iferencak
Copy link
Contributor

I added the unused ruby script. There were a couple of false-positives so I added the customFilterNames array in the script. Usually the delegate methods get flagged so I added the ones I could find in the current codebase to the filter. If there are new false positives, they can just be added to the array. Also, removed names with "_Previews" from triggering.

I agree that the file structure in the project should be a bit more structured, but this was not necessary for this task as the script automatically ignores dependencies.

As for the global switch, I couldn't find a neat way to achieve this, @kcw-grunt did you have some specific way how to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦺 tech debt Actions that help maintain the repo and application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants