trilogy-group / tu2k22-vssubhang

0 stars 0 forks source link

Track GraphDB #34

Open subhang-ti opened 1 year ago

subhang-ti commented 1 year ago
subhang-ti commented 1 year ago
  1. MATCH (n:MethodDeclaration)-[]->(m) RETURN ID(n) AS idmethod,labels(n) AS labelsmethod,properties(n) AS propertiesmethod,ID(m) AS idsomeChild,labels(m) AS labelssomeChild,'child' AS typer LIMIT 25
  2. MATCH (n:TypeDeclaration) RETURN n.longname AS type_longname, n.startline AS type_startline, n.simplename AS name_token, n.startcol AS type_startcol, n.file AS type_file LIMIT 25
  3. MATCH p=(n:PackageDeclaration)-[*2..2]->(m:TypeDeclaration) where m.longname contains 'Page' or m.longname contains 'Crawl' RETURN nodes(p)[0].longname as package_longname, nodes(p)[2].longname as type_longname LIMIT 25
  4. MATCH p=(n:PackageDeclaration)-[*2..2]->(m:TypeDeclaration) RETURN nodes(p)[0].longname as package_longname, collect(distinct(nodes(p))[2].longname) as allClassesUnderPackage LIMIT 25
  5. MATCH (p:TypeDeclaration)-[:supertype0..2]->(q:TypeDeclaration)-[:child]->(m:MethodDeclaration) RETURN p.longname as type_longname, q.longname as superTypeIncludingSelf_longname, m.longname as method_longname, case when ID(p)=ID(q) then 'declared' else 'inherited' end as methodComesFromWhere order by methodComesFromWhere LIMIT 25
  6. MATCH (p:TypeDeclaration)-[:supertype0..2]->(q:TypeDeclaration)-[:child]->(m:MethodDeclaration) RETURN p.longname as type_longname, q.longname as superTypeIncludingSelf_longname, m.longname as method_longname, case when ID(p)=ID(q) then 'declared' else 'inherited' end as methodComesFromWhere order by methodComesFromWhere LIMIT 25
  7. MATCH (s:Statement)-->(n)-->(:ParExpression)-->(e:Expression)-[:child*..7]->(t:TerminalNode) where n.token='if' and t.symbol= 'NULL_LITERAL' RETURN ID(t) + ',' + ID(s) + ',' + ID(e) AS node_ids LIMIT 25
  8. match (t:TerminalNode)-->(:ParExpression)-->(:Statement)-[:child..2]->(:Expression)-[:child]->(t2:TerminalNode) with t, collect(t2.token) as ifc where t.token = 'if' and not 'null' in ifc return t.startline as ifStmt_startline, t.startcol as ifStmt_startcol, t.file as ifStmt_file limit 25
  9. MATCH (td:TypeDeclaration)-->(:ClassDeclaration)-->(:ClassBody)-->(cbd:ClassBodyDeclaration) WHERE cbd.cyclomatic>0 RETURN reverse(collect(cbd.longname)) AS collectmethod_longname, COUNT(cbd) AS countmethod, td.longname AS type_longname, SUM(cbd.cyclomatic) AS summethod_cyclomatic, reverse(collect(cbd.cyclomatic)) AS collectmethod_cyclomatic LIMIT 25
  10. MATCH p=(n:MethodDeclaration)-->(o:MethodBody)-->(b:Block)-->(bs:BlockStatement)-[:child*..8]->(s:Statement) WITH n, COUNT(nodes(p)) AS p WHERE p >= 10 RETURN n.file AS method_file, p AS numStatements, n.endline AS method_endline, n.longname AS method_longname, n.startline AS method_startline LIMIT 25
  11. match (p:MethodDeclaration)-->(:FormalParameters)-->(f:FormalParameterList)-->(fp:FormalParameter) with collect(fp) as cfp, p.longname as method where size(cfp)>4 return method, size(cfp) as numParams limit 25
  12. match (c:MethodDeclaration) where c.endline-c.startline>=50 return c.startline as method_startline, c.longname as method_longname, c.endline as method_endline limit 25