CScout logo


About

CScout: The C Refactoring Browser

Fork me on GitHub CScout is a source code analyzer and refactoring browser for collections of C programs. It can process workspaces of multiple projects (we define a project as a collection of C source files that are linked together) mapping the complexity introduced by the C preprocessor back into the original C source code files. CScout takes advantage of modern hardware advances (fast processors and large memory capacities) to analyze C source code beyond the level of detail and accuracy provided by current compilers, linkers, and other source code analyzers. The analysis CScout performs takes into account the identifier scopes introduced by the C preprocessor and the C language proper scopes and namespaces. After the source code analysis CScout can
  • perform accurate cross project identifier renames,
  • process sophisticated queries on identifiers, files, and functions,
  • locate unused or wrongly-scoped identifiers,
  • identify header files that don't need to be included, and
  • create call graphs spanning both C functions and function-like macros.
CScout has already been applied on projects ranging from tens of thousands of lines, like the Apache web server, to millions of lines, like the Linux, the FreeBSD, and the Windows Research kernels. With CScout you can make your hardware really work for its money. For example, processing the 7.1 Linux kernel for five popular CPU architectures and allyesconfig configuration (32 out of 36 million lines of code) consumed 102 days of CPU time over a period of 53 hours on a 96-core CPU with 256 GB or RAM. The result of this processing is a 167 GiB SQLite database holding details about 11 million identifiers, including 5.5 million macros, mapped to 47 million identifier tokens.
Read more ..., walkthrough (CScout documentation).

The source code of CScout is hosted on GitHub.

CScout runs and has been tested under GNU/Linux, Microsoft Windows, Apple macOS, and FreeBSD, under several processor architectures.