All Projects → ruben2020 → Codequery

ruben2020 / Codequery

Licence: mpl-2.0
A code-understanding, code-browsing or code-search tool. This is a tool to index, then query or search C, C++, Java, Python, Ruby, Go and Javascript source code. It builds upon the databases of cscope and ctags, and provides a nice GUI tool.

Projects that are alternatives of or similar to Codequery

Ctags
A maintained ctags implementation
Stars: ✭ 4,768 (+765.34%)
Mutual labels:  ctags, code-analysis
Sonar Kotlin
SonarQube plugin for Kotlin
Stars: ✭ 412 (-25.23%)
Mutual labels:  code-analysis
lein-codeindex
Index code using etags, ctags or gtags.
Stars: ✭ 19 (-96.55%)
Mutual labels:  ctags
Jsinspect
Detect copy-pasted and structurally similar code
Stars: ✭ 3,379 (+513.25%)
Mutual labels:  code-analysis
Git Fame
Pretty-print `git` repository collaborators sorted by contributions.
Stars: ✭ 272 (-50.64%)
Mutual labels:  code-analysis
Ctags Patterns For Javascript
Exuberant Ctags Patterns for JavaScript
Stars: ✭ 368 (-33.21%)
Mutual labels:  ctags
dotfiles
Your dotfiles are how you personalize your system. These are mine.
Stars: ✭ 12 (-97.82%)
Mutual labels:  ctags
Phpdependencyanalysis
Static code analysis to find violations in a dependency graph
Stars: ✭ 505 (-8.35%)
Mutual labels:  code-analysis
Credo
A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
Stars: ✭ 4,144 (+652.09%)
Mutual labels:  code-analysis
Coala
coala provides a unified command-line interface for linting and fixing all your code, regardless of the programming languages you use.
Stars: ✭ 3,280 (+495.28%)
Mutual labels:  code-analysis
Bblfshd
A self-hosted server for source code parsing
Stars: ✭ 297 (-46.1%)
Mutual labels:  code-analysis
Coala Bears
Bears for coala
Stars: ✭ 276 (-49.91%)
Mutual labels:  code-analysis
Javaparser
Java 1-15 Parser and Abstract Syntax Tree for Java, including preview features to Java 13
Stars: ✭ 3,972 (+620.87%)
Mutual labels:  code-analysis
Wotan
Pluggable TypeScript and JavaScript linter
Stars: ✭ 271 (-50.82%)
Mutual labels:  code-analysis
Gen tags.vim
Async plugin for vim and neovim to ease the use of ctags/gtags
Stars: ✭ 288 (-47.73%)
Mutual labels:  ctags
mps-coderules
Type checking and logical inference for JetBrains MPS
Stars: ✭ 24 (-95.64%)
Mutual labels:  code-analysis
Pmd
An extensible multilanguage static code analyzer.
Stars: ✭ 3,667 (+565.52%)
Mutual labels:  code-analysis
Youcompleteme
A code-completion engine for Vim
Stars: ✭ 23,518 (+4168.24%)
Mutual labels:  code-analysis
Eslint Plugin Sonarjs
SonarJS rules for ESLint
Stars: ✭ 458 (-16.88%)
Mutual labels:  code-analysis
Joern
Open-source code analysis platform for C/C++/Java based on code property graphs
Stars: ✭ 386 (-29.95%)
Mutual labels:  code-analysis

CodeQuery

This is a tool to index, then query or search C, C++, Java, Python, Ruby, Go and Javascript source code.

It builds upon the databases of cscope and Exuberant ctags. It can also work with Universal ctags, which is a drop-in replacement for Exuberant ctags.

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.

Build Status Coverity Status

Latest version = 0.24.0

Windows and Linux binaries available here for download: [email protected] downloads

To build on Linux, please read the INSTALL-LINUX file.

On Mac, the software can be installed through Brew using brew install codequery.

Please read NEWS to find out more.

How is it different from cscope and ctags? What are the advantages?

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, Go and Javascript, in place of cscope.

What features does CodeQuery have?

  • Combines the best of both cscope and ctags
  • Faster due to the use of sqlite for the CodeQuery database
  • Cross-platform GUI tool
  • Fast auto-completion of search term
  • Case-insensitive, partial keyword search - wildcard search supported * and ?
  • Exact match search
  • Filter search results by file path
  • File viewer with syntax highlighting, for UTF-8 encoded source files
  • Ability to open viewed file in an external editor or IDE
  • Visualization of function call graph and class inheritance based on search term
  • Visualization graphs can be saved to PNG or Graphviz DOT files

What types of query can I make?

  • Symbol
  • Function or macro definition
  • Class or struct
  • Functions calling this function
  • Functions called by this function
  • Calls of this function or macro
  • Class which owns this member or method
  • Members and methods of this class
  • Parent of this class (inheritance)
  • Children of this class (inheritance)
  • Files including this file
  • Full path for file
  • Functions and macros inside this file
  • Grep

What does it look like?

CodeQuery screenshot

How does the visualization look like?

Here's a function call graph based on the search term of "updateFilePathLabel". A -> B means A calls B:
Visualization screenshot

Are other editors like vim or emacs or Visual Studio Code supported?

Yes!

There is a vim plugin for CodeQuery called vim-codequery by devjoe.

There is a Visual Studio Code extension for CodeQuery called codequery4vscode by ruben2020. The Visual Studio Code Extension Marketplace page for this extension is ruben2020.codequery4vscode.

We welcome contributors to develop plugins for other editors too.

What does it cost? How is it licensed?

It's freeware and free open source software.

This software is licensed under the Mozilla Public License, version 2.0 (MPL-2.0). See LICENSE.md or LICENSE.txt. This applies to both the distributed Source Code Form and the distributed Executable Form of the software.

To understand the MPL-2.0 license, please read the MPL-2.0 FAQ by mozilla.org.

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 restrictions. It's only dependency is on sqlite3.

Can I use it in a commercial environment without purchasing, for an unlimited time?

Yes. However, donations are welcomed.

Which platforms are supported?

It has been tested on Windows 7 64-bit, Windows XP 32-bit, 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.

Is the software available in other languages?

Yes. This applies only to the GUI tool.

Contributions are welcomed to update or provide new translations.

How to install it?

On Windows, EXE setup packages will be provided here: [email protected] 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, Go and Javascript) 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: [email protected] 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.

How do I use it?

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 workflow

How do I generate whole-program call graphs or UML class diagrams?

CodeQuery cannot do this at the moment.

To generate whole-program call graphs, please use GNU cflow or CodeViz for C and C++. For Java, there is Javashot.

To generate whole-program UML class diagrams for various object-oriented languages, please use tags2uml.

Are there any known limitations?

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.

How do I contact the authors for support, issues, bug reports, fix patches, feature requests etc.?

Please see the email address below, and also the Issues tab in GitHub.

Email address:
Contact address

Website: CodeQuery website

How can I contribute?

  • Report bugs
  • Provide feedback, new ideas, suggestions etc. What would you like to see?
  • Tell your friends, recommend it on StackOverflow or social media
  • Fix bugs (see Issues tab)
  • Update translations (Deutsch, Francais, Japanese etc.)
  • Port to other platforms
  • Write plugins for emacs, eclipse, Notepad++, NetBeans, Jenkins etc.
  • Add support for other languages e.g. Objective-C, Swift

List of Contributors

ruben2020
naseer
bruno-
devjoe
jonashaag
ilovezfs
JCount
brianonn
teungri
stweise
(More welcomed)

Credits

We thank the people behind the following projects:
cscope - our database is derived from this
Exuberant ctags- our database is derived from this
Universal ctags - drop-in replacement for Exuberant ctags
pycscope - our database (for Python) is derived from this
starscope - our database (for Ruby, Go and Javascript) 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
showgraph - visualization done using this library
scintilla - our code editing widget
vim-codequery - vim plugin for CodeQuery
Axialis - free images for CodeQuery and this website
brew - binaries for Mac here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].