wojteklu / depcheck Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Dependency analyzer tool for Swift projects
License: MIT License
[DEPRECATED] Dependency analyzer tool for Swift projects
License: MIT License
Steps to reproduce:
gem install depcheck
Expected Behavior:
graph.png
file on the file systemNotes:
Assumptions:
Xcode version: 9.0.1
Using RVM
Output:
Hanoi julio$ depcheck analyze --project /Users/julio/Github/Hanoi/Hanoi.xcodeproj --scheme Hanoi
1. HanoiViewsTests - 7
2. HanoiTests - 6
3. ViewController - 0
4. AppDelegate - 0
Hanoi julio$ depcheck graph --project /Users/julio/Github/Hanoi/Hanoi.xcodeproj --scheme Hanoi
Hanoi julio$
Here's one example of an output on my production app:
1. TROverviewVC - 51
2. TROverviewVC - 51
3. TROverviewVC - 51
4. TROverviewVC - 50
5. SCInviteVC - 38
6. SCInviteVC - 38
7. SCInviteVC - 38
8. SCInviteVC - 38
9. TRItineraryCardVC - 36
10. TRItineraryCardVC - 36
11. TRItineraryCardVC - 36
12. TRItineraryCardVC - 36
13. TRScheduleVC - 36
14. DeveloperVC - 29
15. DeveloperVC - 29
16. DeveloperVC - 29
17. DeveloperVC - 29
18. STDrivingDocumentVC - 28
19. STDrivingDocumentVC - 28
20. STDrivingDocumentVC - 28
21. STDrivingDocumentVC - 28
22. AppDelegate - 27
23. AppDelegate - 27
24. AppDelegate - 27
25. AppDelegate - 27
26. OBCredentialsVC - 26
27. OBCredentialsVC - 26
...
Side question: how can TROverviewVC
have both a count of 50 and 51?
It would be nice to have a visual representation of the dependency graph (an image). You could use dotty and graphviz (http://www.graphviz.org) for that.
First of all - cool tool! It gave me more insight into my project, so thanks for that!
Second, I would really like to see the ability to exclude certain folders like pods/carthage, because these tend to clutter the results.
Cheers,
Sid
$ depcheck analyze --workspace App.xcworkspace --scheme App
/Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/lib/depcheck/analyzer.rb:29:in `block (2 levels) in generate_dependencies': undefined method `each' for nil:NilClass (NoMethodError)
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/lib/depcheck/analyzer.rb:26:in `each'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/lib/depcheck/analyzer.rb:26:in `block in generate_dependencies'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/lib/depcheck/analyzer.rb:10:in `each'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/lib/depcheck/analyzer.rb:10:in `generate_dependencies'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/lib/depcheck/command/analyze_command.rb:13:in `execute'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/clamp-0.6.5/lib/clamp/subcommand/execution.rb:11:in `execute'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/bin/depcheck:16:in `<top (required)>'
from /Users/ldiqual/.rbenv/versions/2.3.0/bin/depcheck:23:in `load'
from /Users/ldiqual/.rbenv/versions/2.3.0/bin/depcheck:23:in `<main>'
enum ParentEnum {
case Info(enumA: EnumA)
}
enum EnumA {
case A
}
In this case EnumA is showing 0 dependency which is true, but would be nice if we could see if it's been used somewhere (like the case above)
Just having the number of dependencies is a very useful tool, but I would love an option to show what the dependencies are.
Currently depcheck does not support graphing for Watch with error message
No derived data found. Please make sure the project was built.
I did some investigation and found out that this is because In the case of Watch, data are stored inside 'target_name Extension.build' (at least for my project).
I was able to analyze and graph by manually adding ' Extension' inside Finder module.
$ depcheck version
/Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/lib/depcheck/command/version_command.rb:4:in `execute': uninitialized constant Depcheck::VERSION (NameError)
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/clamp-0.6.5/lib/clamp/subcommand/execution.rb:11:in `execute'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'
from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/depcheck-0.1.0/bin/depcheck:16:in `<top (required)>'
from /Users/ldiqual/.rbenv/versions/2.3.0/bin/depcheck:23:in `load'
from /Users/ldiqual/.rbenv/versions/2.3.0/bin/depcheck:23:in `<main>'
Just wanted to report that I get duplicates, sometimes interspersed:
$ depcheck analyze --project TableFlip.xcodeproj
1. TableEventHandler - 18
2. TableEventHandler - 18
3. TableInteractionController - 16
4. TableInteractionController - 16
5. TableInteractionController - 16
6. MarkdownTable - 14
7. MarkdownTable - 14
8. MarkdownTable - 14
9. TableViewModel - 12
10. DocumentStateContextAdapter - 12
11. DocumentStateContextAdapter - 12
12. DocumentStateContextAdapter - 12
13. TableViewModel - 12
14. AppActionContext - 10
15. TableContextMenuController - 10
16. ToolbarItems - 10
17. TableContextMenuController - 10
18. ToolbarItems - 10
19. TableContextMenuController - 10
20. AppActionContext - 10
21. ToolbarItems - 10
22. AppActionContext - 10
I also wonder where the 18 dependencies of the first item come from ๐ค Maybe the rather big Interface Builder file gets in the way?
It would be great if there was an option in the graph
command to simply export the Dot file rather than going through the whole process of generating the GraphViz image. That way the Dot file could be imported into other programs (such as OmniGraffle). It would also make the dependency graph editable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.