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

Function qualified

atomic-audit/src/extract/languages.rs:208–239  ·  view source on GitHub ↗
(node: Node<'_>, source: &str, language: Language)

Source from the content-addressed store, hash-verified

206}
207
208pub(crate) fn qualified(node: Node<'_>, source: &str, language: Language) -> (String, bool) {
209 let mut reliable = true;
210 let mut parts = Vec::new();
211 let mut next = Some(node);
212 while let Some(item) = next {
213 if callable(item, language)
214 || type_boundary(item, language)
215 || matches!(
216 item.kind(),
217 "namespace_definition" | "mod_item" | "impl_item"
218 )
219 {
220 match node_name(item, source).or_else(|| {
221 item.child_by_field_name("type")
222 .map(|kind| text(kind, source).into())
223 }) {
224 Some(name) if !name.is_empty() => parts.push(name),
225 _ => {
226 parts.push(format!("<anonymous@{}>", item.start_byte()));
227 reliable = false;
228 }
229 }
230 }
231 if parts.iter().map(String::len).sum::<usize>() > 2048 {
232 reliable = false;
233 break;
234 }
235 next = item.parent();
236 }
237 parts.reverse();
238 (parts.join("::"), reliable)
239}
240
241pub(super) fn parameters(node: Node<'_>, source: &str, language: Language) -> Measurement {
242 let container = node

Callers 4

parseFunction · 0.70
public_surfaceFunction · 0.70
inspectFunction · 0.50
manageabilityFunction · 0.50

Calls 9

type_boundaryFunction · 0.85
node_nameFunction · 0.85
parentMethod · 0.80
callableFunction · 0.70
textFunction · 0.70
is_emptyMethod · 0.45
pushMethod · 0.45
iterMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected