12
5 Best Dev Tools for Code Search
Today’s article is slightly different from our usual ones. If you’re a developer there is no doubt that you might've gone through the process of searching for code. It can be through the code repository of your organization and you’re trying to implement something new, or it might just be another hobby project and you’re clearing your doubts from StackOverflow. Today, we will take a look at the 5 best dev tools for code search.
![](https://res.cloudinary.com/practicaldev/image/fetch/s---mI13BBh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://uploads-ssl.webflow.com/5e733294d7b5a568ffa60a00/60deb3f22f499bd7650f9b50_5%2520Best%2520Dev%2520Tools%2520for%2520Code%2520Search.png)
This article was originally posted at: https://www.quod.ai/post/5-best-dev-tools-for-code-search
Increasing code base sizes and sophisticated logic are prompting developers to search through code more often. According to a study, it is found that developers search through code at least 5 sessions a day. Most of the searches are surrounding the use of particular APIs, where a particular code is located, how a piece of code is failing, or what a piece of code does. Code search is becoming a crucial part of software development and developers must be equipped with the right tools.
According to the results of the study, we will narrow down our comparison to certain aspects of the tools. Here are two tables to ease the process of understanding what the criteria will be.
With these statistics in mind, we will lay down the basic criteria that we will use to compare the tools. We will assess the tools based on their ability to do the following:
- Get code examples
- Advanced search options
- Code impact analysis
- Ideal for: public code examples
- Pros: easy to use
- Cons: hard to find exact code and to filter to what you want
GitHub has over 190 million repositories and is the largest host of source code in the world. GitHub has tons of features for searching through code and the code review is extremely useful. The default code search in GitHub is not very powerful and the options are very limited. But with the advanced search, you can fine-tune your search by specifying the repository owners, the number of stars that it has, the size of the file, the extension, the number of issues on it, and more.
GitHub is the place you want to be if you want to get code examples. Due to the enormous amount of code hosted on it, there is always something or the other that fits your criteria when looking for examples.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--xxbXsxgF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://uploads-ssl.webflow.com/5e733294d7b5a568ffa60a00/60dbeb997742baa7cd4a2459_QfI6bwYW3qMkbEerGrFKMb2UmvaIJFB6Fdxw3sq2nef2ZZWvYNYem4xJrOV3glIO7iThVkh3sDOTBETcum9ZaozPs4uRhrgokAeT96YDihl4GaQy50qG2DC3xIPq3X6aVnHmzTmw.png)
In terms of searching, there are a lot of advanced options available, but to make the most of it, you will need to know what exactly you’re searching for. GitHub doesn’t let you search for exact pieces of code but rather only by project and file names. Searching for example repositories is pretty straightforward, and you can use the search bar to search for it from your current repository, your current organization or from all of GitHub.
The advanced options might not ring any bells if you haven’t seen them before. Since GitHub also powers the Git version control system, it can be used to review pull requests, view the impact of merges if there are any conflicts, and take necessary corrective action.
- Ideal for: in-depth code search, impact analysis
- Pros: easy to use interface, integrates with Git/Github, JIRA, versatile code search
- Cons: programming languages is limited to Javascript, Typescript, Java, Python and Ruby
Quod AI is an AI-powered tool that does a lot of the work for you. It allows you to search for code, find experts and impacts from GitHub repositories as well as from Jira issues. QuodAI can be a great tool if used in addition to GitHub because both of them complement each other very well. If you have found a particular code example that you’re looking for on GitHub, you can connect the repository to Quod AI.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--NEAJ88JV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://uploads-ssl.webflow.com/5e733294d7b5a568ffa60a00/60dbeb99eaa48a2c57f64ecc_t6WxDkaFQ08OeLJbiYzl-LrNvc0zqXOJvYxcIZ4RUy15GsfCqlo_dGhYRF1vR6zSmEDAX7a46lPAh40kKk1pMOjFozdL0q2mq-b3omm5q8iK0-fvza2cu1UXohuPzNo1TYCoLjnU.png)
Once the connection is made, Quod AI uses artificial intelligence to scan through the entire repository and generate questions and tags. These questions redirect you to code snippets where the particular operation is performed and the tags will redirect you to all the snippets where that tag might be relevant. For example, if there is a tag called API, it will take you to all the controllers in your source code where an API may be implemented. The advanced search allows you to filter down to technical tags, business tags, the path (right down to a specific file), modified date, and file extensions. The UI is very simple to get accustomed to and there is also a quick demo to walk you through everything when you first start.
- Ideal for: searching local code
- Pros: de-facto text editor for software development, plethora of extensions available
- Cons: code search is not very feature-rich
VSCode is Microsoft’s very own code editor that has become the de-facto standard in the industry. It is being used by a huge majority of developers thanks to the rich ecosystem of extensions that it supports. Once you have a working repository on your machine, you can open it in VSCode to search through it. Searching is not very feature-rich but is pretty good for a code editor. VSCode has extensions with Git that can show a preliminary impact analysis but again, this is restricted, considering it is a code editor.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--Ua6_CmFu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://uploads-ssl.webflow.com/5e733294d7b5a568ffa60a00/60dbeb9afb13b4fd66705fa1_WTfc4ew3uw5lYtACgsemn1y9SqHqV7BJ1G5HH5fjyP8Nsg130ETFWUZs-IvxDtFaScn3fTOOsLvrbnirBgeo_GLdvQr3XCnErdNwBiP5e3jIvpVuBTzmKOfjNSGfgpL6uVzxNq7R.png)
- Ideal for: searching through large codebases
- Pros: supports multiple repository types, code search is fast
- Cons: complex-UI, need to understand querying
SourceGraph is a web-based code search and navigation engine. In our opinion, it has a complex UI and will need some getting used to. You can link your GitHub or GitLab accounts and select the repositories you want to search for or you can add public repositories as well. Their searching is fast and there are quite a few advanced search options that you can try. The searches are made through certain queries which you can find here, so it is a little difficult for someone trying it for the first time to try and understand these. It doesn’t have any functionality to view the impacts as well.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--eGsvZ0vM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://uploads-ssl.webflow.com/5e733294d7b5a568ffa60a00/60dbeda48e109cbcf4a05fe1_9a86m0GODJlW7ujai-7_R8-B1DkvoQWDg5M1pi65K9Q0vElEP_Xv_gNR9oRRolmzMULSW2OVFASW1Qdqw5Aeab7F1eMxVsUIsVHtdB-A-QjAuDBhuOugztnwU6hs9wKSXDb-X-PX.png)
- Ideal for: searching through code quickly, better suited to more advanced users
- Pros: supports multiple version control systems, fast code search
- Cons: difficult to set up, initial configuration is a little difficult
Opengrok is a source code browser and code navigation tool. It is extremely fast to search for code and can make complex search queries but the initial configuration required is a little difficult for the faint-hearted. But they do have a Docker image which simplifies the process. Opengrok is an extremely feature-rich code browser and it supports full-text search, definition and identifier search, path and history search, API searches, using logical operators to chain queries, etc. It supports a lot of version control systems like Git, RCS, CVS, Monotone, and more. Opengrok too doesn’t support any kind of impact analysis.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--GMyqcf9Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://uploads-ssl.webflow.com/5e733294d7b5a568ffa60a00/60dbeb9a9775fd56eaa7cf7b_Ga0KHlO45Xx8uodAr7h8f_a_BjzN94fh2dUUK8hoXh18wLn0US7JxOV6u6EEbj8vdXKISqu8ioqz0nXckhxVdiDosnUp7WORcGvdJK6zmi41YGi4z388o9GkBjwxA8pxjKKuyk3w.png)
That’s it for our 5 best dev tools for code search. In our opinion, the tool that you use depends a lot on what you’re trying to achieve. We think that to get the best results, you shouldn’t stick to one tool, but use them in conjunction to maximize efficiency.
12