How to find method and class usages along git repositories

We got some code in a git repository that’s used along different projects (with git different repositories), the problem is that we got now so many different projects that’s difficult to track which projects will be affected and how when there is a change in the shared module.

Is there any way to find classes and methods usages along different git repositories? Or who would you manage an architecture like that?

1

Take a look at some code quality and code indexing tools.

FishEye

For starters, you could use FishEye, which would index your code and allow you to quickly query for code from all the repositories so you can keep a bird’s eye view of the whole codebase.

For instance, you could search for a given file (but also for a file’s content, including a method name) and it will find affiliated tickets and changesets that modified it, and its latest version in your code repositories:

However, FishEye doesn’t necessarily understand the code and see methods as units to be tracked, so you can’t say “find call points of method M of class C”.

Sonar

A code quality tool like Sonar would also allow you to keep an eye on dependencies (especially if you have a maven-based build).

For instance, a very handy view is this one:

It allows you to see the connections between different components in terms of dependencies, so you know that a change to this component might impact the other ones.

Read here for more.

Again, it doesn’t really tell you that at the method level though (it relies on the dependency graph of the binary dependencies of your build).

Update: Actually, looks like Sonar even does method level tracking (see the SonarSource blog I linked above):

Krugle

Available online for open-source project repositories, you can also deploy your own instance (basic version for free).

http://www.krugle.org/

CodeSight

Host your own CodeSight instance.

http://www.blackducksoftware.com/products/code-sight

Elastic Search

GitHub uses it since January 2013, so if your git repo is GitHub-hosted you can already benefit from that. Otherwise you can roll out your own.


Roll Out Your Own

Probably not adviseable, but you could probably produce an indexed database of your code using a nightly job parsing your projects and using a full-text search engine (like Apache Lucene, for instance), or even something more low-tech than that.


You can find more tooling support for code analysis and graphing at the class level, but you’d end up with pretty complicated and unreadable graphs very quickly anyways, for any relatively large system.

Many build systems have plugins for that sort of thing.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật