Class Lines of Code

28 views
Skip to first unread message

nafei...@gmail.com

unread,
Jan 31, 2019, 8:35:42 AM1/31/19
to jQAssistant
Hello,

I have a question about class nodes.
Is there a way to scan the LOC (lines of code) of classes like the method properties 'lastlinenumber'?

Best Regards,
Lisa

Dirk Mahler

unread,
Jan 31, 2019, 8:44:13 AM1/31/19
to jqass...@googlegroups.com
Hi Lisa,

there's no property on class level for LoC because this metric cannot determined from scanning bytecode. But you can aggregate the values provided from properties on Method nodes:

MATCH
  (t:Type)-[:DECLARES]->(m:Method)
WHERE
  exists(m.effectiveLineCount)
RETURN
  t.fqn, sum(m.effectiveLineCount) as loc
ORDER BY
  loc desc

Note that methods have three properties relating to line numbers:

- firstLineNumber and lastLineNumner: the first/last line number that have been found for a method
- effectiveLineCount: the number of distinct line numbers that contain executable bytecode for this method

Cheers,

Dirk

------ Originalnachricht ------
An: "jQAssistant" <jqass...@googlegroups.com>
Gesendet: 31.01.2019 14:35:41
Betreff: [jQAssistant] Class Lines of Code

--
You received this message because you are subscribed to the Google Groups "jQAssistant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jqassistant...@googlegroups.com.
To post to this group, send email to jqass...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages