Feature "Code Graph"

From Dataspects
C0935229673
Jump to: navigation, search
[edit]
Get a graph from a facet of your code base showing function calls.
EntityType "Feature"
Keywords/Contexts


Annotations

See below…





What is available for faceting?[edit | edit source]

MATCH annot=(subj)-[pred:dsm__CallsFunction]->(obj)
	WITH reduce(x = [], y IN keys(subj) | x + y ) as ss, pred AS pred, obj AS obj
	UNWIND ss as sss
    WITH reduce(x = [], y IN keys(pred) | x + y ) as pp, obj AS obj, sss AS sss
	UNWIND pp as ppp
    WITH reduce(x = [], y IN keys(obj) | x + y ) as oo, sss AS sss, ppp AS ppp
	UNWIND oo as ooo
		RETURN collect(distinct sss), collect(distinct ppp), collect(distinct ooo)

Example result from above Cypher[edit | edit source]

╒══════════════════════════════════════════════════════════════════════╤══════════════════════════════════════════════════════════════════════╤═══════════════════════╕
│"collect(distinct sss)"                                               │"collect(distinct ppp)"                                               │"collect(distinct ooo)"│
╞══════════════════════════════════════════════════════════════════════╪══════════════════════════════════════════════════════════════════════╪═══════════════════════╡
│["dsm__AttachedToStruct","dsm__VariablesReferToStructMap","dam__HasEnt│["dam__nodeLikeTypeLabel","dsm__SMWPropertyType","receiverArtefact","d│["name"]               │
│ityID","dam__OriginatedFromResourceSiloLabel","dsm__DeclaredInPackage"│am__Context","dam__Comment","dam__PredicateScope","dam__OriginatedFrom│                       │
│,"dsm__isIndexedToESIndex","dam__SIGINTExplanation","dam__HasEntityBlu│ResourceSiloLabel"]                                                   │                       │
│rbHTML","dam__OriginatedFromResourceURL","dam__OriginatedFromResourceT│                                                                      │                       │
│ype","dam__HasEntityBlurbSource","dam__HasEntityTitle","dam__Originate│                                                                      │                       │
│dFromResourceName","dam__HasEntityContentSOURCE","dam__HasEntityType",│                                                                      │                       │
│"dam__HasEntityName","name","dam__HasEntityURL","dam__HasEntityClass",│                                                                      │                       │
│"dam__HasEntityContentHTML"]                                          │                                                                      │                       │
└──────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────┴───────────────────────┘

Load a facet[edit | edit source]

MATCH a=(s)-[p:dsm__CallsFunction]->(o)
WHERE s.dsm__DeclaredInPackage IS NOT NULL
    AND s.dsm__AttachedToStruct IN ["Page"]
    OR s.dsm__DeclaredInPackage IN ["mediawiki", "sigint"]
        RETURN 	s.name, type(p), o.name
        //RETURN 	s, p, o