Struct might_be_minified::Analysis
[−]
[src]
pub struct Analysis { /* fields omitted */ }
Provides an analysis of a source file
Methods
impl Analysis
[src]
fn space_to_code_ratio(&self) -> f32
Returns the whitespace to code ratio
This is a useful metric to decide on if a file is likely minified code or regular JavaScript code.
fn median_ident_length(&self) -> usize
The median identifier length
This returns the median length for an identifier (name) in the JS source code.
fn longest_line(&self) -> usize
The longest code line length
This returns the length of the longest line. This includes comments and other things.
fn shape(&self) -> f32
The "shape" of the code file
This essentially is height / width
of the file where the height is
the actual number of lines however the width is the p75 line length.
fn minified_probability(&self) -> f32
The proability of the file being minified
Effectively 1.0 (which is unlikely to be reached) means the file is definitely minified. Anything above 0.5 is considered likely to be minified.
fn is_likely_minified(&self) -> bool
Indicates that the file is likely minified