How to count lines of Java code using IntelliJ IDEA?

前端 未结 9 477
慢半拍i
慢半拍i 2020-12-07 09:25

How to count lines of Java code using IntelliJ IDEA?

相关标签:
9条回答
  • 2020-12-07 09:56

    In the past I have used the excellently named MetricsReloaded plugin to get this information.

    You can install it from the JetBrains repository.

    Once installed, access via: Analyze -> Calculate Metrics...

    0 讨论(0)
  • 2020-12-07 10:00

    You can to use Count Lines of Code (CLOC)

    On Settings -> External Tools add a new tool

    • Name: Count Lines of Code
    • Group: Statistics
    • Program: path/to/cloc
    • Parameters: $ProjectFileDir$ or $FileParentDir$
    0 讨论(0)
  • 2020-12-07 10:00

    To find all including empty lines of code try @Neil's solution:

    Open Find in Path (Ctrl+Shift+F)

    Search for the following regular expression: \n'

    For lines with at least one character use following expression:

    (.+)\n
    

    For lines with at least one word character or digit use following expression:

    `(.*)([\w\d]+)(.*)\n`
    

    Notice: But the last line of file is just counted if you have a line break after it.

    0 讨论(0)
提交回复
热议问题