Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move metrics in their own module #156

Merged
merged 2 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/asttools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn get_parent<'a>(node: &'a Node<'a>, level: usize) -> Option<Node<'a>> {
Some(node)
}

#[macro_export]
macro_rules! has_ancestors {
($node:expr, $( $typs:pat )|*, $( $typ:pat ),+) => {{
let mut res = false;
Expand Down
24 changes: 3 additions & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,15 @@ pub use crate::enums::*;
pub mod node;
pub use crate::node::*;

mod rca_metrics;
pub(crate) use rca_metrics::*;

pub mod web;

#[macro_use]
pub mod asttools;
pub use crate::asttools::*;

pub mod cyclomatic;
pub use crate::cyclomatic::*;

pub mod exit;
pub use crate::exit::*;

pub mod loc;
pub use crate::loc::*;

pub mod mi;
pub use crate::mi::*;

pub mod halstead;
pub use crate::halstead::*;

pub mod nom;
pub use crate::nom::*;

pub mod fn_args;
pub use crate::fn_args::*;

pub mod metrics;
pub use crate::metrics::*;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/mi.rs → src/rca_metrics/mi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use serde::Serialize;
use std::fmt;
use tree_sitter::Node;

use crate::cyclomatic;
use crate::halstead;
use crate::loc;
use super::cyclomatic;
use super::halstead;
use super::loc;

use crate::checker::Checker;

Expand Down
7 changes: 7 additions & 0 deletions src/rca_metrics/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pub mod cyclomatic;
pub mod exit;
pub mod fn_args;
pub mod halstead;
pub mod loc;
pub mod mi;
pub mod nom;
File renamed without changes.