All Projects → mozilla → rust-code-analysis

mozilla / rust-code-analysis

Licence: other
Library to analyze and collect metrics on source code

Programming Languages

c
50402 projects - #5 most used programming language
rust
11053 projects
python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
shell
77523 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to rust-code-analysis

get-source
Fetch source-mapped sources. Peek by file, line, column. Node & browsers. Sync & async.
Stars: ✭ 26 (-84.8%)
Mutual labels:  source-code-analysis
objc-runtime-CN
Objective-C Runtime Analysis (Objective-C运行时分析)
Stars: ✭ 28 (-83.63%)
Mutual labels:  source-code-analysis
Spring Analysis
Spring源码阅读
Stars: ✭ 11,249 (+6478.36%)
Mutual labels:  source-code-analysis
Jdk Sourcecode Analysis
JDK源码阅读笔记
Stars: ✭ 1,646 (+862.57%)
Mutual labels:  source-code-analysis
emerge
emerge is a source code analysis tool and dependency visualizer that can be used to gather insights about source code structure, metrics, dependencies and complexity of software projects. After scanning the source code of a project it provides you an interactive web interface to explore and analyze your project by using graph structures.
Stars: ✭ 120 (-29.82%)
Mutual labels:  source-code-analysis
import-graph
🕵🏻‍♂️ Collect data about your dependencies
Stars: ✭ 35 (-79.53%)
Mutual labels:  source-code-analysis
go-namecheck
Source code analyzer that helps you to maintain variable/field naming conventions inside your project.
Stars: ✭ 37 (-78.36%)
Mutual labels:  source-code-analysis
codeprep
A toolkit for pre-processing large source code corpora
Stars: ✭ 39 (-77.19%)
Mutual labels:  source-code-analysis
android-source-codes
⚙️ Code analysis of common Android projects and components.
Stars: ✭ 59 (-65.5%)
Mutual labels:  source-code-analysis
JPlag
Detecting Software Plagiarism and Collusion since 1996.
Stars: ✭ 674 (+294.15%)
Mutual labels:  source-code-analysis

rust-code-analysis

Task Status codecov

rust-code-analysis is a Rust library to analyze and extract information from source code written in many different programming languages. It is based on a parser generator tool and an incremental parsing library called Tree Sitter.

A command line tool called rust-code-analysis-cli is provided to interact with the API of the library in an easy way.

This tool can be used to:

  • Call rust-code-analysis API
  • Print nodes and metrics information
  • Export metrics in different formats

In addition, we provide a rust-code-analysis-web tool to use the library through a REST API.

Usage

rust-code-analysis supports many types of programming languages and computes a great variety of metrics. You can find up to date documentation at Documentation.

On the Commands page, there is a list of commands that can be run to get information about metrics, nodes, and other general data provided by this software.

Building

To build the rust-code-analysis library, you need to run the following command:

cargo build

If you want to build the cli:

cargo build -p rust-code-analysis-cli

If you want to build the web server:

cargo build -p rust-code-analysis-web

If you want to build everything in one fell swoop:

cargo build --workspace

Testing

To verify whether all tests pass, run the cargo test command.

cargo test --workspace --all-features --verbose

Updating insta tests

We use insta, to update the snapshot tests you should install cargo insta

cargo insta test --review

Will run the tests, generate the new snapshot references and let you review them.

Contributing

If you want to contribute to the development of this software, have a look at the guidelines contained in our Developers Guide.

How to cite rust-code-analysis

@article{ARDITO2020100635,
    title = {rust-code-analysis: A Rust library to analyze and extract maintainability information from source codes},
    journal = {SoftwareX},
    volume = {12},
    pages = {100635},
    year = {2020},
    issn = {2352-7110},
    doi = {https://doi.org/10.1016/j.softx.2020.100635},
    url = {https://www.sciencedirect.com/science/article/pii/S2352711020303484},
    author = {Luca Ardito and Luca Barbato and Marco Castelluccio and Riccardo Coppola and Calixte Denizet and Sylvestre Ledru and Michele Valsesia},
    keywords = {Algorithm, Software metrics, Software maintainability, Software quality},
    abstract = {The literature proposes many software metrics for evaluating the source code non-functional properties, such as its complexity and maintainability. The literature also proposes several tools to compute those properties on source codes developed with many different software languages. However, the Rust language emergence has not been paired by the community’s effort in developing parsers and tools able to compute metrics for the Rust source code. Also, metrics tools often fall short in providing immediate means of comparing maintainability metrics between different algorithms or coding languages. We hence introduce rust-code-analysis, a Rust library that allows the extraction of a set of eleven maintainability metrics for ten different languages, including Rust. rust-code-analysis, through the Abstract Syntax Tree (AST) of a source file, allows the inspection of the code structure, analyzing source code metrics at different levels of granularity, and finding code syntax errors before compiling time. The tool also offers a command-line interface that allows exporting the results in different formats. The possibility of analyzing source codes written in different programming languages enables simple and systematic comparisons between the metrics produced from different empirical and large-scale analysis sources.}
}

Licenses

  • Mozilla-defined grammars are released under the MIT license.

  • rust-code-analysis, rust-code-analysis-cli and rust-code-analysis-web are released under the Mozilla Public License v2.0.

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].