Eclipse count lines of code

后端 未结 10 1040
孤城傲影
孤城傲影 2021-01-29 19:06

I\'ve tried the Metrics plugin and although it\'s nice and all, it\'s not what my boss is looking for. It counts a line with just one } as a line and he doesn\'t wa

10条回答
  •  余生分开走
    2021-01-29 19:28

    If on OSX or *NIX use

    Get all actual lines of java code from *.java files

    find . -name "*.java" -exec grep "[a-zA-Z0-9{}]" {} \; | wc -l
    

    Get all lines from the *.java files, which includes empty lines and comments

    find . -name "*.java" -exec cat | wc -l
    

    Get information per File, this will give you [ path to file + "," + number of lines ]

    find . -name "*.java" -exec wc -l {} \;
    

提交回复
热议问题