This is a tool to index, then query or search C, C++, Java, Python, Ruby and Go source code.
The databases of cscope and ctags would be processed by the cqmakedb tool to generate the CodeQuery database file.
The CodeQuery database file can be viewed and queried using the codequery GUI tool.
Windows and Linux binaries available here for download: CodeQuery@sourceforge downloads
To build on Linux, please read the INSTALL-LINUX file. The latest git version (HEAD on master branch) can be used.
Please read NEWS to find out more.
Both cscope and ctags can do symbol lookup and identify functions, macros, classes and structs.
cscope is very C-centric, but is fuzzy enough to cover C++ and Java, but not very well for e.g. it doesn't understand destructors and class member instantiations. It can't provide relationships of class inheritance and membership. cscope can do "functions that call this function" and "functions called by this function". This is a very powerful feature that makes cscope stand out among comparable tools.
ctags does many languages well and understands destructors, member instantiations, and the relationships of class membership and inheritance. From ctags, we can find out "members and methods of this class", "class which owns this member or method", "parent of this class", "child of this class" etc. However, it doesn't do "functions that call this function" or "functions called by this function".
So both these tools have their pros and cons, but complement each other.
CodeQuery is a project that attempts to combine the features available from both cscope and ctags, provide faster database access compared to cscope (because it uses sqlite) and provides a nice GUI tool as well. Due to this faster database access, fast auto-completion of search terms and multiple complex queries to perform visualization is possible.
In addition, pycscope is used to add support for Python, in place of cscope.
In addition, starscope is used to add support for Ruby and Go, in place of cscope.
Here's a function call graph based on the search term of "updateFilePathLabel". A -> B means A calls B:
It's freeware and free open source software.
Files under the
querylib directory are licensed under the MIT license. See QueryLib README. This is a library to query CodeQuery database files. This library is MIT-licensed, so that it may be used to create plugins for editors, IDEs and other software without license restrictions. It's only dependency is on sqlite3.
Yes. However, donations are welcomed.
It has been tested on Windows 7 64-bit, Windows XP, Mac OS X, Ubuntu and Fedora Linux 64-bit and, Ubuntu and Fedora Linux 32-bit.
Contributions are welcomed to attempt ports to other operating systems.
Yes. This applies only to the GUI tool.
Contributions are welcomed to update or provide new translations.
On Windows, EXE setup packages will be provided here: CodeQuery@sourceforge downloads. The EXE setup package shall also contain cscope.exe, ctags.exe and the required DLLs. So, everything you need is in one package. However, pycscope (optional - only for Python) and starscope (optional - only for Ruby and Go) are not bundled together with this setup package and need to be installed separately.
On Linux, tar.gz, RPM and Debian package installations will be provided here: CodeQuery@sourceforge downloads.
On Mac, the software can be installed through Brew using
brew install codequery.
To build on Linux and Mac, please read the INSTALL-LINUX file.
Version 15.8a of cscope or higher, works best with CodeQuery.
On Windows: HOWTO-WINDOWS. This file is included in the EXE setup package.
On Linux and Mac: HOWTO-LINUX
Please read the HOWTO file provided for each platform. The workflow looks like this:
CodeQuery cannot do this at the moment.
To generate whole-program UML class diagrams for various object-oriented languages, please use tags2uml.
For C and C++, inline assembly code is not supported by all the tools. This mainly affects embedded software, OS and driver code.
Please exclude files with inline assembly code from the list of files (cscope.files) to be scanned.
Follow us on our FreeCode page and you should receive emails notifying you of new version releases.
And don't forget to up-vote CodeQuery on FreeCode and star it on Github if you like this project.
Please see the email address below, and also the Issues tab in GitHub.
Website: CodeQuery website
We thank the people behind the following projects:
cscope - our database is derived from this
Exuberant ctags- our database is derived from this
pycscope - our database (for Python) is derived from this
starscope - our database (for Ruby and Go) is derived from this
sqlite3 - our database is using this format
CMake - cross-platform build toolchain for CodeQuery
Qt open source - GUI toolkit used to build CodeQuery
optlist - cqmakedb uses this to parse command line options
showgraph - visualization done using this library
scintilla - our code editing widget (in the form of QScintilla)
Axialis - free images for CodeQuery and this website
brew - binaries for Mac here