Back to directory
P3HPC avatar
P3HPC / code-base-investigator

code-base-investigator

An analysis tool providing insight into the portability and maintainability of an application’s source code.

33

Stars

10

Forks

6

Watchers

BSD-3-Clause

License

Code Base Investigator

DOI OpenSSF Best Practices

Code Base Investigator (CBI) is an analysis tool that provides insight into the portability and maintainability of an application's source code.

  • Measure code divergence and platform coverage to understand how much code is specialized for different compilers, operating systems, hardware micro-architectures and more.

  • Visualize the distance between the code paths used to support different compilation targets.

  • Identify stale, legacy, code paths that are unused by any compilation target.

  • Export metrics and code path information required for P3 analysis using other tools.

Table of Contents

Dependencies

  • jsonschema
  • Matplotlib
  • NumPy
  • pathspec
  • Python 3
  • SciPy
  • tabulate
  • tqdm

Installation

The latest release of CBI is version 2.0.0. To download and install this release, run the following:

pip install git+https://github.com/P3HPC/[email protected]

We strongly recommend installing CBI within a virtual environment.

Getting Started

After installation, run codebasin -h to see a complete list of options.

A full tutorial can be found in the online documentation.

Contribute

Contributions to CBI are welcome in the form of issues and pull requests.

See CONTRIBUTING for more information.

License

BSD 3-Clause

Security

See SECURITY for more information.

The main branch of CBI is the development branch, and should not be used in production. Tagged releases are available here.

Code of Conduct

We have adopted the Contributor Covenant as the Code of Conduct for this project. See CODE OF CONDUCT for more information.

Citations

If your use of CBI results in a research publication, please consider citing the software and/or the papers that inspired its functionality (as appropriate). See CITATION for more information.

Releases

May 16, 2025

Code Base Investigator v2.0.0

Download .zip

WarningCode Base Investigator 2.0.0 is a major release that includes several breaking changes.

New Features

Errors and warnings are written to a cbi.log file, to reduce verbosity and improve the use...

Mar 28, 2024

Code Base Investigator v1.2.0

Download .zip

Although a minor release, Code Base Investigator v1.2.0 includes a few significant changes. ImportantIn previous releases of Code Base Investigator, the main script was called codebasin.py. The old na...

Jun 2, 2023

Code Base Investigator v1.1.0

Download .zip

What's Changed

Macro expansion overhaul by @jasonsewall-intel in #3 Refactor walkers, add optional code passthrough, and add etc/preprocess script by @jasonsewall-intel in #4 Improve readability of d...

Jun 23, 2021

Code Base Investigator v1.05

Download .zip

This release contains an improved tokenizer and parser, as well as updates to usability.

1.0

Jun 23, 2021

Code Base Investigator v1.0

Download .zip

Initial release of Code Base Investigator.