Crate rust_code_analysis[−][src]
rust-code-analysis is a library to analyze and extract information from source codes written in many different programming languages.
You can find the source code of this software on GitHub, while issues and feature requests can be posted on the respective GitHub Issue Tracker.
Supported Languages
- C++
- C#
- CSS
- Go
- HTML
- Java
- JavaScript
- The JavaScript used in Firefox internal
- Python
- Rust
- Typescript
Supported Metrics
- CC: it calculates the code complexity examining the control flow of a program.
- SLOC: it counts the number of lines in a source file.
- PLOC: it counts the number of physical lines (instructions) contained in a source file.
- LLOC: it counts the number of logical lines (statements) contained in a source file.
- CLOC: it counts the number of comments in a source file.
- BLANK: it counts the number of blank lines in a source file.
- HALSTEAD: it is a suite that provides a series of information, such as the effort required to maintain the analyzed code, the size in bits to store the program, the difficulty to understand the code, an estimate of the number of bugs present in the codebase, and an estimate of the time needed to implement the software.
- MI: it is a suite that allows to evaluate the maintainability of a software.
- NOM: it counts the number of functions and closures in a file/trait/class.
- NEXITS: it counts the number of possible exit points from a method/function.
- NARGS: it counts the number of arguments of a function/method.
Modules
cognitive | |
cyclomatic | |
exit | |
fn_args | |
halstead | |
loc | |
mi | |
nom |
Structs
AstCallback | |
AstCfg | Configuration options for retrieving the nodes of an |
AstNode | Information on an |
AstPayload | The payload of an |
AstResponse | The response of an |
CcommentCode | |
CodeMetrics | All metrics data. |
CommentRm | |
CommentRmCfg | Configuration options for removing comments from a code. |
Count | Count of different types of nodes in a code. |
CountCfg | Configuration options for counting different types of nodes in a code. |
CppCode | |
Dump | |
DumpCfg | Configuration options for dumping the |
Filter | |
Find | |
FindCfg | Configuration options for finding different types of nodes in a code. |
FuncSpace | Function space data. |
Function | |
FunctionCfg | Configuration options for detecting the span of each function in a code. |
FunctionSpan | Function span data. |
JavaCode | |
JavascriptCode | |
Metrics | |
MetricsCfg | Configuration options for computing the metrics of a code. |
MozjsCode | |
Node | An |
Parser | |
PreprocCode | |
PreprocFile | Preprocessor data of a |
PreprocResults | Preprocessor data of a series of |
PythonCode | |
RustCode | |
TsxCode | |
TypescriptCode |
Enums
LANG | The list of supported languages. |
SpaceKind | The list of supported space kinds. |
Traits
Callback | A trait for callback functions. |
Functions
action | Runs a function, which implements the |
count | Counts the types of nodes specified in the input slice and the number of nodes in a code. |
dump_node | Dumps the |
dump_root | Dumps the metrics of a code. |
find | Finds the types of nodes specified in the input slice. |
fix_includes | Constructs a dependency graph of the include directives
in a |
function | Detects the span of each function in a code. |
get_from_emacs_mode | Detects the language associated to the input |
get_from_ext | Detects the language associated to the input file extension. |
get_function_spaces | Returns all function spaces data of a code. |
get_language_for_file | Detects the language of a code using the extension of a file. |
get_macros | Returns the macros contained in a |
guess_language | Guesses the language of a code. |
metrics | Returns all function spaces data of a code. This function needs a parser to be created a priori in order to work. |
preprocess | Extracts preprocessor data from a |
read_file | Reads a file. |
read_file_with_eol | Reads a file and adds an |
rm_comments | Removes comments from a code. |
write_file | Writes data to a file. |
Type Definitions
CcommentParser | The |
CppParser | The |
JavaParser | The |
JavascriptParser | The |
MozjsParser | The |
PreprocParser | The |
PythonParser | The |
RustParser | The |
Span | Start and end positions of a node in a code in terms of rows and columns. |
TsxParser | The |
TypescriptParser | The |