MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / rules

Function rules

atomic-audit/src/substantive/tests.rs:4–15  ·  view source on GitHub ↗
(path: &str, source: &str)

Source from the content-addressed store, hash-verified

2use atomic_semantic::ParserRegistry;
3
4fn rules(path: &str, source: &str) -> Vec<Rule> {
5 let inspection = inspect(&mut ParserRegistry::new(), path, source).unwrap();
6 assert!(
7 !inspection.has_syntax_errors,
8 "fixture must parse: {source}"
9 );
10 inspection
11 .issues
12 .into_iter()
13 .map(|issue| issue.rule)
14 .collect()
15}
16
17fn long_function(branches: usize, lines: usize) -> String {
18 let mut source = String::from("fn large(x:i32) {\n");

Calls 4

inspectFunction · 0.70
unwrapMethod · 0.45
collectMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected