Skip to main content

codelore_rca/
lib.rs

1// Vendored MPL-2.0 fork of Mozilla's rust-code-analysis. Don't refactor
2// upstream code to satisfy newer clippy lints — keep the divergence from
3// upstream minimal. Crate-level allows below cover lints introduced in
4// Rust toolchain bumps that the upstream code happens to trigger.
5#![allow(clippy::collapsible_match)]
6
7//! rust-code-analysis is a library to analyze and extract information
8//! from source codes written in many different programming languages.
9//!
10//! You can find the source code of this software on
11//! <a href="https://github.com/mozilla/rust-code-analysis/" target="_blank">GitHub</a>,
12//! while issues and feature requests can be posted on the respective
13//! <a href="https://github.com/mozilla/rust-code-analysis/issues/" target="_blank">GitHub Issue Tracker</a>.
14//!
15//! ## Supported Languages
16//!
17//! - C++
18//! - C#
19//! - CSS
20//! - Go
21//! - HTML
22//! - Java
23//! - JavaScript
24//! - The JavaScript used in Firefox internal
25//! - Python
26//! - Rust
27//! - Typescript
28//!
29//! ## Supported Metrics
30//!
31//! - CC: it calculates the code complexity examining the
32//!   control flow of a program.
33//! - SLOC: it counts the number of lines in a source file.
34//! - PLOC: it counts the number of physical lines (instructions)
35//!   contained in a source file.
36//! - LLOC: it counts the number of logical lines (statements)
37//!   contained in a source file.
38//! - CLOC: it counts the number of comments in a source file.
39//! - BLANK: it counts the number of blank lines in a source file.
40//! - HALSTEAD: it is a suite that provides a series of information,
41//!   such as the effort required to maintain the analyzed code,
42//!   the size in bits to store the program, the difficulty to understand
43//!   the code, an estimate of the number of bugs present in the codebase,
44//!   and an estimate of the time needed to implement the software.
45//! - MI: it is a suite that allows to evaluate the maintainability
46//!   of a software.
47//! - NOM: it counts the number of functions and closures
48//!   in a file/trait/class.
49//! - NEXITS: it counts the number of possible exit points
50//!   from a method/function.
51//! - NARGS: it counts the number of arguments of a function/method.
52
53#![allow(clippy::upper_case_acronyms)]
54
55mod c_langs_macros;
56mod c_macro;
57mod getter;
58mod macros;
59
60mod alterator;
61pub use alterator::*;
62
63mod node;
64pub use crate::node::*;
65
66mod metrics;
67pub use metrics::*;
68
69mod languages;
70pub(crate) use languages::*;
71
72mod checker;
73pub(crate) use checker::*;
74
75mod output;
76pub use output::*;
77
78mod spaces;
79pub use crate::spaces::*;
80
81mod ops;
82pub use crate::ops::*;
83
84mod find;
85pub use crate::find::*;
86
87mod function;
88pub use crate::function::*;
89
90mod ast;
91pub use crate::ast::*;
92
93mod count;
94pub use crate::count::*;
95
96mod preproc;
97pub use crate::preproc::*;
98
99mod langs;
100pub use crate::langs::*;
101
102mod tools;
103pub use crate::tools::*;
104
105mod concurrent_files;
106pub use crate::concurrent_files::*;
107
108mod traits;
109pub use crate::traits::*;
110
111mod parser;
112pub use crate::parser::*;
113
114mod comment_rm;
115pub use crate::comment_rm::*;