JavaScript, Resources

Cocycle Code Search: Finding Open Source Code by Functionality

Cocycles is a new & free technology which comes in the form of a code search engine for developers. It currently supports Javascript, and additional languages should be supported later this year. It allows developers to search for open source code by functionality. Meaning, searching for code using plain english. So, how does it work and how to make the best of it?

Basically, Cocycles has one significant advantage over searching for code using traditional search engines such as Google, Bing and others. Unlike them, Cocycles actually understands code, and can read through lines of code while understanding how it behaves.

pic1

The result is, Cocycles is able to process millions of lines of code and identify different units within them: Functions, Classes, libraries and more. It is then able to tell what each unit actually does. The second thing Cocycles does (and this is a work in progress), is understanding natural language. Or, in different words, plain English.

With these two capabilities, Cocycles is able to understand what is the functionality a developer is really looking for, and what pieces of open source code actually do exactly that. For example, a developer might be looking for an example on how to parse the headers of an HTTP request in Javascript. Using cocycles, that developer can easily type the query “parse http headers” and receive a variety of full source implementations from across the open source.

picture 2

Each result will contain the code itself, presented in an IDE-like full code view, along with original documentation, real usage examples and useful metadata.
Exploring the code before deciding if it’s a good fit can be done by simply clicking on different definitions within the code view, jumping between them and understanding the environment of the desired unit. If the code isn’t a good fit, it’s possible to easily browse between different results through a quick result browse that remains open at all times.

picture 3
As mentioned, the unit result view will not only include the code itself. Should the developers who originally wrote the code chose to document the specific unit, Cocycles will also make sure to bring this documentation in a separate view. It will also locate, gather and present with examples on how this unit had been actually put to use, hopefully providing a quick answer to the question “ok, so- how do I use this?”.

Additional metadata presented includes the unit’s source on GitHub, it’s popularity, how common is it around the open source and more.

picture 4

A few more neat features include an immediate view of an accurate result if Cocycles finds one, may it be a library, a framework component or other piece of code (see above). It will also include the abilty to generate a fully functional snippet from within the unit screen– allowing a developer to copy not only the code itself, but also all sub-functions and dependencies it needs to work. This tech cannot be found anywhere else at the moment, and come in useful when dealing with a complicated function which relies on an entire set of other functions.

Cocycles was built to help developers find code and to make sure the open source becomes what it supposed to be: truly open and accessible.

CoCycles
Cocycle Code Search: Finding Open Source Code by Functionality
4.57 (91.43%) 7 votes
Please follow and like us:

1 Comment

  1. Mo

    Awesome!

Leave a Reply