Skip to content

Commit

Permalink
Do not export internal metric functions as public
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannitangredi authored and Luni-4 committed Mar 4, 2022
1 parent 98538cb commit 7c21e14
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/metrics/cognitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl Stats {
pub fn cognitive_average(&self) -> f64 {
self.cognitive_sum() / self.total_space_functions as f64
}
pub fn compute_minmax(&mut self) {
pub(crate) fn compute_minmax(&mut self) {
self.structural_min = self.structural_min.min(self.structural);
self.structural_max = self.structural_max.max(self.structural);
self.structural_sum += self.structural;
Expand Down
3 changes: 1 addition & 2 deletions src/metrics/cyclomatic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ impl Stats {
pub fn cyclomatic_min(&self) -> f64 {
self.cyclomatic_min
}
/// Last step for computing minimum and maximum value and update cyclomatic_sum
pub fn compute_minmax(&mut self) {
pub(crate) fn compute_minmax(&mut self) {
self.cyclomatic_max = self.cyclomatic_max.max(self.cyclomatic);
self.cyclomatic_min = self.cyclomatic_min.min(self.cyclomatic);
self.cyclomatic_sum += self.cyclomatic;
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Stats {
pub fn exit_average(&self) -> f64 {
self.exit_sum() / self.total_space_functions as f64
}
pub fn compute_minmax(&mut self) {
pub(crate) fn compute_minmax(&mut self) {
self.exit_max = self.exit_max.max(self.exit);
self.exit_min = self.exit_min.min(self.exit);
self.exit_sum += self.exit;
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/nargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Stats {
self.closure_nargs_max as f64
}

pub fn compute_minmax(&mut self) {
pub(crate) fn compute_minmax(&mut self) {
self.closure_nargs_min = self.closure_nargs_min.min(self.closure_nargs);
self.closure_nargs_max = self.closure_nargs_max.max(self.closure_nargs);
self.fn_nargs_min = self.fn_nargs_min.min(self.fn_nargs);
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/nom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl Stats {
pub fn total(&self) -> f64 {
self.functions_sum() + self.closures_sum()
}
pub fn compute_minmax(&mut self) {
pub(crate) fn compute_minmax(&mut self) {
self.functions_min = self.functions_min.min(self.functions);
self.functions_max = self.functions_max.max(self.functions);
self.closures_min = self.closures_min.min(self.closures);
Expand Down

0 comments on commit 7c21e14

Please sign in to comment.