28

Per the Official Google Blog:

Code Search, which was designed to help people search for open source code all over the web, will be shut down along with the Code Search API on January 15, 2012.

Google Code Search is now gone, and since that makes it much harder to understand the features it presented, here's my attempt to render them via information I gathered from a cache of the page for the Search Options:

The "In Search Box" just notes the syntax to type the command directly in the main search box instead of using the advance search interface.

  • Package (In Search Box: "package:linux-2.6")
  • Language (In Search Box: "lang:c++")
    • (OPTIONS: any language, actionscript, ada, applescript, asp, assembly, autoconf, automake, awk, basic, bat, c, c#, c++, caja, cobol, coldfusion, configure, css, d, eiffel, erlang, fortran, go, haskell, inform, java, java, javascript, jsp, lex, limbo, lisp, lolcode, lua, m4, makefile, maple, mathematica, matlab, messagecatalog, modula2, modula3, objectivec, ocaml, pascal, perl, php, pod, prolog, proto, python, python, r, rebol, ruby, sas, scheme, scilab, sgml, shell, smalltalk, sml, sql, svg, tcl, tex, texinfo, troff, verilog, vhdl, vim, xslt, xul, yacc)
  • File (In Search Box: "file:^.*.java$")
  • Class (In Search Box: "class:HashMap")
  • Function (In Search Box: "function:toString")
  • License (In Search Box: "license:mozilla")
    • (OPTIONS: null/any-license, aladdin/Aladdin-Public-License, artistic/Artistic-License, apache/Apache-License, apple/Apple-Public-Source-License, bsd/BSD-License, cpl/Common-Public-License, epl/Eclipse-Public-License, agpl/GNU-Affero-General-Public-License, gpl/GNU-General-Public-License, lgpl/GNU-Lesser-General-Public-License, disclaimer/Historical-Permission-Notice-and-Disclaimer, ibm/IBM-Public-License, lucent/Lucent-Public-License, mit/MIT-License, mozilla/Mozilla-Public-License, nasa/NASA-Open-Source-Agreement, python/Python-Software-Foundation-License, qpl/Q-Public-License, sleepycat/Sleepycat-License, zope/Zope-Public-License)
  • Case Sensitive (In Search Box: "case:no")
    • (OPTIONS: yes, no)

Also of use in understanding the search tool would be the still live FAQs page for Google Code Search.

Is there any code search engine that would fully replace Google Code Search's features?

4

4 Answers 4

18

Seven similar code search engines are presented as alternatives at alternativeTo.net:

Koders.com

Koders is a syntax-specific (33 languages, soon to be 43) open source code search engine that enables developers to find, understand, and use open source code. Koders has a search index of several billion lines of code, and will further expand this to include the extensive project list on ohloh.net.

search[code]

search[code] is a code specific search engine. API documentation, code snippets and open source (free sofware) repositories are indexed and searchable. Most information is presented in such a way that you shouldn't need to click through, but of course you always can.

SymbolHound

SymbolHound offers symbol-inclusive search of open source code repositories, in addition to a feature that allows regular web searches for otherwise-ignored special characters.

Black Duck Code Sight

Black Duck® Code Sight™ is a scalable, syntax-specific (43 languages) source code search engine that enables developers to find, understand, and use shared code. Code Sight's out-of-the-box adapters allow a search index to be created from a file system or across multiple source code management systems and types. The free version limitation is 5 million LOCs

Codase

Codase is the leading source code search company with advanced source code understanding and xml index/search technologies. Rather than treating code as text, Codase understands programming languages, and treats code as code, the way it's supposed to be. This unique and syntax-aware approach provides the most accurate and detailed search results with fine granularity levels of controls. With Codase, one can search functions, classes, strings, constants, macros, comments and other programming language constructs.

GrepCode

GrepCode.com is a code search engine built by developers for developers to search and browse open source Java projects.

zGrepCode

zGrepCode.com is your helper to browse open source code online. It lets you navigate code in IDE style where you can follow references, read inline documentation, and share the code snippets anywhere easily.

A very similar service is Snipplr, a code snippet search engine. I don't think there's an obvious alternative, all services have their distinct features, you will have to evaluate them for yourself and see which one you enjoy the most.

Worth noting that Google Code Search is not really dead yet.

3
  • 1
    I would recommend Snip2Code: snip2code.com. It has a powerful search engine like the one of Google Code Search, high integration in IDEs like Eclipse, Visual Studio, IntelliJ, Notepad++, and a good growing communty of coders posting new snippets in all the languages May 16, 2014 at 6:37
  • 1
    Another option is zgrepcode.com, this not only gives you an alternative to grepcode (As grepcode is down), but also gives you an IDE experience on web browser along with code snippets and samples. Feb 5, 2019 at 18:41
  • GrepCode.com has been discontinued. I think the alternative to it is zGrepCode.com
    – Arry
    Feb 23, 2019 at 6:56
12

Try this: Koders

Edit

Update: Koders has merged with Ohloh.

3
  • 2
    Unfortunately it is not as flexible as CodeSearch, but well, looks like we have to live with it :-/
    – johannes
    Oct 16, 2011 at 21:28
  • It can't regexes and gives millions of duplicates... goo.gl/ODY1U versus goo.gl/q6QVZ
    – Nakilon
    Oct 23, 2011 at 2:42
  • 2
    Link only answers are not particularly helpful, please expand your answer to tell us why you suggest Koders as an alternative to Google Code Search.
    – yannis
    Feb 27, 2012 at 1:29
4

6 November 2012 a regexp code search engine for all Debian packages was announced on the debian-devel mailing list:

http://codesearch.debian.net/

Search queries can be written in regular expression syntax defined by re2.

It is possible to search for a specific file type (C, C++, Perl, Python, Go, Java, Ruby, Shell) where the files have been filtered out by their extension.

Debian is very serious about Software licensing. If you find code in this search engine you can be confident that the software is fulfilling the requirements for being open source software.

It is also great to be able to search in the debian/rules files. They are normally not distributed in source packages outside of Debian. In these files you can see how the package was built for Debian, e.g. which options that were given to the CMake command (if CMake was the build system in the package).

2

Also there is http://www.koders.com/:

Koders.com, a Black Duck Software Company, is a free on-line search engine for open source software and other web-downloadable code.

Over 30,000 developers each day rely on Koders to search over 1 billion lines of code written in over 30 languages and identified with 28 software licenses.

Koders is helping to fuel the open source software revolution. Developers can use this free resource to quickly find the best reusable open source code, methods, examples, algorithms and more, enabling them to be more successful with open source and complete projects faster.

Not the answer you're looking for? Browse other questions tagged or ask your own question.